]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Output ES6 from babel (#7136)
authorJukka Kurkela <jukka.kurkela@gmail.com>
Fri, 21 Feb 2020 23:55:53 +0000 (01:55 +0200)
committerGitHub <noreply@github.com>
Fri, 21 Feb 2020 23:55:53 +0000 (18:55 -0500)
babel.config.json
gulpfile.js
karma.conf.js
rollup.config.js

index 8f0b771ebf879c10ccb0526c1e471f3f8c9e882c..dedc58c80ae3f9a4f4a484727d54d428d7878c6e 100644 (file)
@@ -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
index 0d479999c27eb2a68ecbfa3ac1def407b78465e3..4aebb98736577596f13b83a2de116767d26cc0e3 100644 (file)
@@ -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,
index 8fc9bfa525264c9ef7df81746214916682fb81fc..4372ee2b07ba6a764d9eaacd35d47f3dfc57c340 100644 (file)
@@ -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: {
index ec157f576c8a884f95130dae3d197c0ecfb1220e..877a3b7f1af4829a8b4193e4c5803882afe869b0 100644 (file)
@@ -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