Przeglądaj źródła

feat: set package build target to `es2017` (#4341)

David Luzar 3 lat temu
rodzic
commit
dfbfbc3f11

+ 4 - 0
src/packages/excalidraw/CHANGELOG.md

@@ -66,6 +66,10 @@ Please add the latest change on the top under the correct section.
 
   The `Appearance` type is now removed and renamed to `Theme` so `Theme` type needs to be used.
 
+### Build
+
+- We're now compiling to `es2017` target. Notably, `async/await` is not compiled down to generators. [#4341](https://github.com/excalidraw/excalidraw/pull/4341)
+
 ---
 
 ## 0.10.0 (2021-10-13)

+ 1 - 1
src/packages/excalidraw/package.json

@@ -72,7 +72,7 @@
   "homepage": "https://github.com/excalidraw/excalidraw/tree/master/src/packages/excalidraw",
   "scripts": {
     "gen:types": "tsc --project ../../../tsconfig-types.json",
-    "build:umd": "cross-env NODE_ENV=production webpack --config webpack.prod.config.js && cross-env NODE_ENV=development webpack --config webpack.dev.config.js && yarn gen:types",
+    "build:umd": "rm -rf dist && cross-env NODE_ENV=production webpack --config webpack.prod.config.js && cross-env NODE_ENV=development webpack --config webpack.dev.config.js && yarn gen:types",
     "build:umd:withAnalyzer": "cross-env NODE_ENV=production ANALYZER=true webpack --config webpack.prod.config.js",
     "pack": "yarn build:umd && yarn pack"
   },

+ 0 - 3
src/packages/excalidraw/webpack.prod.config.js

@@ -63,10 +63,7 @@ module.exports = {
                 "@babel/preset-typescript",
               ],
               plugins: [
-                "@babel/plugin-proposal-object-rest-spread",
-                "@babel/plugin-transform-arrow-functions",
                 "transform-class-properties",
-                "@babel/plugin-transform-async-to-generator",
                 "@babel/plugin-transform-runtime",
               ],
             },

+ 1 - 1
src/packages/tsconfig.prod.json

@@ -1,6 +1,6 @@
 {
   "compilerOptions": {
-    "target": "es5",
+    "target": "es2017",
     "module": "es2015",
     "moduleResolution": "node",
     "resolveJsonModule": true,