From dfbfbc3f11673e0de70dadb3ab4001a9b9721632 Mon Sep 17 00:00:00 2001 From: David Luzar Date: Tue, 7 Dec 2021 16:38:46 +0100 Subject: [PATCH] feat: set package build target to `es2017` (#4341) --- src/packages/excalidraw/CHANGELOG.md | 4 ++++ src/packages/excalidraw/package.json | 2 +- src/packages/excalidraw/webpack.prod.config.js | 3 --- src/packages/tsconfig.prod.json | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/packages/excalidraw/CHANGELOG.md b/src/packages/excalidraw/CHANGELOG.md index f14f6d38..607396c8 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 2c874bde..1e7fcc2a 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 8c34fe73..ffe99f2f 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 4ea7246b..974b4631 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,