Skip to content

Commit 2ddf5e2

Browse files
committed
fix(index.js): support commonjs module syntax
Add module.exports syntax for supporting the exporting of main functionality
1 parent 0408315 commit 2ddf5e2

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

src/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ import * as parsers from './parsers';
44

55
export default objToString;
66
export { parsers, createParser };
7+
module.exports = objToString;
8+
module.exports.createParser = createParser;
9+
module.exports.parsers = { ...parsers };

utils/build-utils/webpack.development.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = env => ({
44
devtool: 'cheap-eval-source-map',
55
output: {
66
filename: 'index.umd.js',
7-
library: 'styleObjToStr',
7+
library: 'styleToCss',
88
libraryTarget: 'umd',
99
},
1010
});

utils/build-utils/webpack.production.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,7 @@
22
module.exports = env => ({
33
output: {
44
filename: 'index.min.js',
5+
library: 'styleToCss',
6+
libraryTarget: 'umd',
57
},
68
});

0 commit comments

Comments
 (0)