Skip to content

Commit

Permalink
Added a flag to return either CommonJS or ES6 module export format, n…
Browse files Browse the repository at this point in the history
…ot sure about name, what about `cjsExport`?
  • Loading branch information
visualfanatic committed Sep 24, 2018
1 parent 3a23e75 commit 4d3e9fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ module.exports = (content, options = {}) => {
const {
svgoConfig = {},
svgoPath = null,
es6Export = false,
} = options;

let svg = Promise.resolve(content);
Expand Down Expand Up @@ -44,7 +45,7 @@ module.exports = (content, options = {}) => {
});

return `
module.exports = {
${es6Export ? 'export default' : 'module.exports ='} {
functional: true,
render: ${renderFunction},
};
Expand Down

0 comments on commit 4d3e9fd

Please sign in to comment.