Skip to content

Commit

Permalink
fix: add @babel/preset-env in rollup config (#336)
Browse files Browse the repository at this point in the history
Closes #335
  • Loading branch information
gregberge committed May 14, 2019
1 parent a47a635 commit 8b50c94
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"bundlesize": [
{
"path": "./packages/component/dist/loadable.min.js",
"maxSize": "2 kB"
"maxSize": "2.5 kB"
},
{
"path": "./packages/component/dist/loadable.esm.js",
"maxSize": "3 kB"
"maxSize": "3.5 kB"
}
],
"scripts": {
Expand Down
18 changes: 9 additions & 9 deletions packages/component/.size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"dist/loadable.cjs.js": {
"bundled": 10177,
"minified": 5008,
"gzipped": 1931
"bundled": 12669,
"minified": 6097,
"gzipped": 2189
},
"dist/loadable.esm.js": {
"bundled": 9858,
"minified": 4743,
"gzipped": 1857,
"bundled": 12286,
"minified": 5788,
"gzipped": 2122,
"treeshaked": {
"rollup": {
"code": 3158,
"import_statements": 60
"code": 259,
"import_statements": 259
},
"webpack": {
"code": 4211
"code": 5063
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion packages/component/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ const external = id => !id.startsWith('.') && !id.startsWith('/')
const getBabelOptions = ({ useESModules }) => ({
exclude: '**/node_modules/**',
runtimeHelpers: true,
presets: [['@babel/preset-react', { useBuiltIns: true }]],
presets: [
['@babel/preset-env', { loose: true }],
['@babel/preset-react', { useBuiltIns: true }],
],
plugins: [
'@babel/plugin-proposal-class-properties',
'babel-plugin-annotate-pure-calls',
Expand Down

0 comments on commit 8b50c94

Please sign in to comment.