Parcourir la source

Switch to preset-env for babel (#476)

Paulus Schoutsen il y a 1 an
Parent
commit
df7b4c69e0
3 fichiers modifiés avec 1472 ajouts et 828 suppressions
  1. 1461 823
      package-lock.json
  2. 1 2
      package.json
  3. 10 3
      rollup.config.mjs

Fichier diff supprimé car celui-ci est trop grand
+ 1461 - 823
package-lock.json


+ 1 - 2
package.json

@@ -10,8 +10,7 @@
     "prepublishOnly": "script/build"
   },
   "devDependencies": {
-    "@babel/plugin-proposal-class-properties": "^7.18.6",
-    "@babel/plugin-transform-logical-assignment-operators": "^7.23.4",
+    "@babel/preset-env": "^7.23.9",
     "@rollup/plugin-babel": "^6.0.4",
     "@rollup/plugin-commonjs": "^25.0.7",
     "@rollup/plugin-json": "^6.1.0",

+ 10 - 3
rollup.config.mjs

@@ -20,9 +20,16 @@ const config = {
     }),
     babel({
       babelHelpers: "bundled",
-      plugins: [
-        "@babel/plugin-proposal-class-properties",
-        "@babel/plugin-transform-logical-assignment-operators",
+      presets: [
+        [
+          "@babel/preset-env",
+          {
+            targets: {
+              // We use unpkg as CDN and it doesn't bundle modern syntax
+              chrome: "84",
+            },
+          },
+        ],
       ],
     }),
     json(),

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff