From 607eb6d1308c388709b73ce7da35d2b222bb5729 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 5 Jan 2021 16:03:55 +0100 Subject: [PATCH] Prefer target over environment (#8092) --- build-scripts/webpack.js | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/build-scripts/webpack.js b/build-scripts/webpack.js index d29521ce35..fb4f572748 100644 --- a/build-scripts/webpack.js +++ b/build-scripts/webpack.js @@ -36,6 +36,7 @@ const createWebpackConfig = ({ const ignorePackages = bundle.ignorePackages({ latestBuild }); return { mode: isProdBuild ? "production" : "development", + target: ["web", latestBuild ? "es2017" : "es5"], devtool: isProdBuild ? "cheap-module-source-map" : "eval-cheap-module-source-map", @@ -131,22 +132,6 @@ const createWebpackConfig = ({ } return `${chunk.name}.${chunk.hash.substr(0, 8)}.js`; }, - environment: { - // The environment supports arrow functions ('() => { ... }'). - arrowFunction: latestBuild, - // The environment supports BigInt as literal (123n). - bigIntLiteral: false, - // The environment supports const and let for variable declarations. - const: latestBuild, - // The environment supports destructuring ('{ a, b } = obj'). - destructuring: latestBuild, - // The environment supports an async import() function to import EcmaScript modules. - dynamicImport: latestBuild, - // The environment supports 'for of' iteration ('for (const x of array) { ... }'). - forOf: latestBuild, - // The environment supports ECMAScript Module syntax to import ECMAScript modules (import ... from '...'). - module: latestBuild, - }, chunkFilename: isProdBuild && !isStatsBuild ? "chunk.[chunkhash].js"