diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-05-04 21:35:21 +1000 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2020-05-04 21:35:21 +1000 |
commit | c8cb22863bf8c3ac157f6098be9154908aea9ec2 (patch) | |
tree | b27b1bf6ec4c90bbd0cb335e26bb9ece504285d2 /.config/rollup.tests.js | |
parent | 59f09a1a2317e57d13bbe8f60e1949cc82199ead (diff) | |
download | svg.js-c8cb22863bf8c3ac157f6098be9154908aea9ec2.tar.gz svg.js-c8cb22863bf8c3ac157f6098be9154908aea9ec2.zip |
Fixed IE Polyfills, got rid of ArrayPolyfill in favour of babels own transforms, updated dependencies, finished tests, removed old es5 tests
Diffstat (limited to '.config/rollup.tests.js')
-rw-r--r-- | .config/rollup.tests.js | 55 |
1 files changed, 36 insertions, 19 deletions
diff --git a/.config/rollup.tests.js b/.config/rollup.tests.js index e524a79..3620149 100644 --- a/.config/rollup.tests.js +++ b/.config/rollup.tests.js @@ -1,5 +1,33 @@ -import babel from 'rollup-plugin-babel' -import multiEntry from 'rollup-plugin-multi-entry' +import * as pkg from '../package.json' +import babel from '@rollup/plugin-babel' +import multiEntry from '@rollup/plugin-multi-entry' +import resolve from '@rollup/plugin-node-resolve' +import commonjs from '@rollup/plugin-commonjs' + +const getBabelConfig = (targets) => babel({ + include: ['src/**', 'spec/**/*'], + babelHelpers: 'runtime', + babelrc: false, + 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, + // corejs: 3, + bugfixes: true + }]], + plugins: [ + ['@babel/plugin-transform-runtime', { + corejs: 3, + helpers: true, + useESModules: true, + version: "^7.9.6", + regenerator: false + }] + ] +}) export default { input: [ @@ -9,24 +37,13 @@ export default { output: { file: 'spec/es5TestBundle.js', name: 'SVGTests', - sourceMap: true, - format: 'iife' + format: 'iife', }, plugins: [ - babel({ - include: 'src/**', - runtimeHelpers: true, - babelrc: false, - presets: [['@babel/preset-env', { - modules: false - }]] - // plugins: [["@babel/plugin-transform-runtime", { - // corejs: false, - // helpers: true, - // regenerator: true, - // useESModules: true - // }]] - }), + resolve({ browser: true }), + commonjs(), + getBabelConfig(), multiEntry() - ] + ], + external: ['@babel/runtime', '@babel/runtime-corejs3'] } |