From: Jukka Kurkela Date: Fri, 21 Feb 2020 23:55:53 +0000 (+0200) Subject: Output ES6 from babel (#7136) X-Git-Tag: v3.0.0-alpha~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=564c027a1efb2b76c78ae10a26faf1488cf2f9cc;p=thirdparty%2FChart.js.git Output ES6 from babel (#7136) --- diff --git a/babel.config.json b/babel.config.json index 8f0b771eb..dedc58c80 100644 --- a/babel.config.json +++ b/babel.config.json @@ -1,12 +1,33 @@ { - "presets": ["@babel/preset-env"], + "presets": [ + "@babel/preset-env" + ], "plugins": [ "@babel/plugin-proposal-class-properties", "@babel/plugin-transform-object-assign" ], "env": { + "es6": { + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "esmodules": true + }, + "modules": false, + "useBuiltIns": false + } + ] + ], + "plugins": [ + "@babel/plugin-proposal-class-properties" + ] + }, "test": { - "plugins": ["istanbul"] + "plugins": [ + "istanbul" + ] } } -} +} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 0d479999c..4aebb9873 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -162,7 +162,6 @@ function docsTask(done) { } function unittestTask(done) { - process.env.NODE_ENV = 'test'; new karma.Server({ configFile: path.join(__dirname, 'karma.conf.js'), singleRun: !argv.watch, diff --git a/karma.conf.js b/karma.conf.js index 8fc9bfa52..4372ee2b0 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -67,7 +67,7 @@ module.exports = function(karma) { rollupPreprocessor: { plugins: [ resolve(), - babel({exclude: 'node_modules/**'}), // use babel since we have ES proposal features + babel({envName: 'test', exclude: 'node_modules/**'}), // use babel since we have ES proposal features commonjs() ], output: { diff --git a/rollup.config.js b/rollup.config.js index ec157f576..877a3b7f1 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -86,7 +86,7 @@ module.exports = [ plugins: [ json(), resolve(), - babel(), + babel({envName: 'es6'}), cleanup({ sourcemap: true }) @@ -110,7 +110,7 @@ module.exports = [ plugins: [ json(), resolve(), - babel(), + babel({envName: 'es6'}), terser({ output: { preamble: banner