diff --git a/packages/config-webpack/package.json b/packages/config-webpack/package.json index c243c7314..fabafc794 100644 --- a/packages/config-webpack/package.json +++ b/packages/config-webpack/package.json @@ -11,6 +11,7 @@ "@types/circular-dependency-plugin": "^5", "babel-loader": "^8.0.0", "circular-dependency-plugin": "^5.2.2", + "ecma-version-validator-webpack-plugin": "^1.2.1", "terser-webpack-plugin": "^5.1.4", "webpack": "^5.76.0", "webpack-cli": "^4.8.0", diff --git a/packages/config-webpack/webpack.config.common.js b/packages/config-webpack/webpack.config.common.js index 2d310ab8e..c9762daae 100644 --- a/packages/config-webpack/webpack.config.common.js +++ b/packages/config-webpack/webpack.config.common.js @@ -1,5 +1,8 @@ const TerserPlugin = require('terser-webpack-plugin') const CircularDependencyPlugin = require('circular-dependency-plugin') +const { + ECMAVersionValidatorPlugin, +} = require('ecma-version-validator-webpack-plugin') const isProd = process.env.NODE_ENV === 'production' const isWatch = process.env.WATCH === 'true' @@ -67,5 +70,6 @@ module.exports = { new CircularDependencyPlugin({ failOnError: true, }), + new ECMAVersionValidatorPlugin({ ecmaVersion: 5 }), // ensure we don't accidentally break ie11 syntax. ], } diff --git a/yarn.lock b/yarn.lock index 93611b8e0..11d7a833e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2507,6 +2507,7 @@ __metadata: "@types/circular-dependency-plugin": ^5 babel-loader: ^8.0.0 circular-dependency-plugin: ^5.2.2 + ecma-version-validator-webpack-plugin: ^1.2.1 terser-webpack-plugin: ^5.1.4 webpack: ^5.76.0 webpack-cli: ^4.8.0 @@ -9707,6 +9708,17 @@ __metadata: languageName: node linkType: hard +"ecma-version-validator-webpack-plugin@npm:^1.2.1": + version: 1.2.1 + resolution: "ecma-version-validator-webpack-plugin@npm:1.2.1" + dependencies: + acorn: ^8.7.0 + peerDependencies: + webpack: ^4.40.0 || ^5.0.0 + checksum: 9a0f6d9beb600f1af054f65a52790c3784d5d4c19cb10b9ae7446682613349ade952b355cca0e60b45616e66ce9b1914d183a909ce136bb05b47f364dd6bfabf + languageName: node + linkType: hard + "edge-paths@npm:^3.0.5": version: 3.0.5 resolution: "edge-paths@npm:3.0.5"