Skip to content

Virtual whiteboard for sketching hand-drawn like diagrams

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

David Luzardfbfbc3f1167
diff --git a/src/packages/excalidraw/CHANGELOG.md b/src/packages/excalidraw/CHANGELOG.md
index f14f6d38c4..607396c890 100644
--- a/src/packages/excalidraw/CHANGELOG.md
+++ b/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)
diff --git a/src/packages/excalidraw/package.json b/src/packages/excalidraw/package.json
index 2c874bde6a..1e7fcc2a52 100644
--- a/src/packages/excalidraw/package.json
+++ b/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"
},
diff --git a/src/packages/excalidraw/webpack.prod.config.js b/src/packages/excalidraw/webpack.prod.config.js
index 8c34fe73af..ffe99f2f5b 100644
--- a/src/packages/excalidraw/webpack.prod.config.js
+++ b/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",
],
},
diff --git a/src/packages/tsconfig.prod.json b/src/packages/tsconfig.prod.json
index 4ea7246ba6..974b46318f 100644
--- a/src/packages/tsconfig.prod.json
+++ b/src/packages/tsconfig.prod.json
@@ -1,6 +1,6 @@
{
"compilerOptions": {
- "target": "es5",
+ "target": "es2017",
"module": "es2015",
"moduleResolution": "node",
"resolveJsonModule": true,