Skip to content

Commit 7b00b67

Browse files
committed
add cjs and esm builds
1 parent 8b78c77 commit 7b00b67

7 files changed

+87
-286
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@
66
.idea
77
npm-debug.log
88
node_modules
9+
lib
910
dist

.npmignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
.eslintrc
99
npm-debug.log
1010
lib
11+
dist

babel.config.js

+35-19
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
1-
const presets = [
2-
[
3-
'@babel/env',
4-
{
5-
useBuiltIns: 'usage'
6-
}
7-
],
8-
[
9-
'@babel/react',
10-
{
11-
useBuiltIns: true
12-
}
13-
],
14-
'minify'
15-
];
16-
17-
const plugins = ['@babel/plugin-proposal-class-properties'];
18-
19-
module.exports = { presets, plugins };
1+
const presets = [
2+
[
3+
'@babel/env',
4+
{
5+
useBuiltIns: 'usage'
6+
}
7+
],
8+
[
9+
'@babel/react',
10+
{
11+
useBuiltIns: true
12+
}
13+
]
14+
];
15+
16+
const plugins = [
17+
'@babel/plugin-transform-runtime',
18+
'@babel/plugin-proposal-class-properties'
19+
];
20+
21+
const env = {
22+
esm: {
23+
presets: [
24+
[
25+
'@babel/env',
26+
{
27+
modules: false,
28+
useBuiltIns: 'usage'
29+
}
30+
]
31+
]
32+
}
33+
};
34+
35+
module.exports = { presets, plugins, env };

0 commit comments

Comments
 (0)