diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2021-06-14 00:46:42 +0200 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2021-06-14 00:46:42 +0200 |
commit | 0e2833b4f2f51278d6e405c95461aa797fe783de (patch) | |
tree | 46ba82e5a5ffcbd827ba8ca19119b0e26f18e74e /.config | |
parent | 34062cfa7731ab0c0d1df94b931fede0c57f1f09 (diff) | |
download | svg.js-0e2833b4f2f51278d6e405c95461aa797fe783de.tar.gz svg.js-0e2833b4f2f51278d6e405c95461aa797fe783de.zip |
cleaned up config, reduced bundle size by a lot!!!
Diffstat (limited to '.config')
-rw-r--r-- | .config/rollup.config.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/.config/rollup.config.js b/.config/rollup.config.js index 91ab2cd..8391ba0 100644 --- a/.config/rollup.config.js +++ b/.config/rollup.config.js @@ -24,18 +24,17 @@ const getBabelConfig = (node = false) => { let targets = pkg.browserslist const plugins = [ - ['@babel/plugin-transform-classes'], - ['@babel/plugin-transform-runtime', { - corejs: 3, - helpers: true, - useESModules: true, + ['@babel/transform-runtime', { version: "^7.14.5", - regenerator: false + regenerator: false, + useESModules: true + }], + ["polyfill-corejs3", { + "method": "usage-pure" }] ] if (node) { - plugins.shift() targets = 'maintained node versions' } @@ -43,14 +42,15 @@ const getBabelConfig = (node = false) => { include: 'src/**', babelHelpers: 'runtime', babelrc: false, + targets: targets, presets: [['@babel/preset-env', { modules: false, - targets: targets || pkg.browserslist, // useBuildins and plugin-transform-runtime are mutually exclusive // https://github.com/babel/babel/issues/10271#issuecomment-528379505 // use babel-polyfills when released useBuiltIns: false, - bugfixes: true + bugfixes: true, + loose: true }]], plugins }) @@ -110,7 +110,7 @@ const config = (node, min, esm = false) => ({ plugins: [ resolve({ browser: !node }), commonjs(), - getBabelConfig(node && 'maintained node versions'), + getBabelConfig(node), filesize(), !min ? {} : terser({ mangle: { @@ -120,8 +120,7 @@ const config = (node, min, esm = false) => ({ preamble: headerShort } }) - ], - // external: [/@babel\/runtime/, /@babel\/runtime-corejs3/]//['@babel/runtime', '@babel/runtime-corejs3'] + ] }) // [node, minified, esm] |