Skip to content

Commit

Permalink
fix(index.js): support commonjs module syntax
Browse files Browse the repository at this point in the history
Add module.exports syntax for supporting the exporting of main functionality
  • Loading branch information
Tbhesswebber committed Feb 17, 2019
1 parent 0408315 commit 2ddf5e2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ import * as parsers from './parsers';

export default objToString;
export { parsers, createParser };
module.exports = objToString;
module.exports.createParser = createParser;
module.exports.parsers = { ...parsers };
2 changes: 1 addition & 1 deletion utils/build-utils/webpack.development.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = env => ({
devtool: 'cheap-eval-source-map',
output: {
filename: 'index.umd.js',
library: 'styleObjToStr',
library: 'styleToCss',
libraryTarget: 'umd',
},
});
2 changes: 2 additions & 0 deletions utils/build-utils/webpack.production.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
module.exports = env => ({
output: {
filename: 'index.min.js',
library: 'styleToCss',
libraryTarget: 'umd',
},
});

0 comments on commit 2ddf5e2

Please sign in to comment.