From 4e169576a526023ee297d5bc8b37eedba229f63d Mon Sep 17 00:00:00 2001 From: Toru Nagashima Date: Tue, 24 Dec 2019 05:57:15 +0900 Subject: [PATCH] Build: update browser build (#12693) --- Makefile.js | 13 ------------- webpack.config.js | 23 +++++++++++++++++++++-- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/Makefile.js b/Makefile.js index 2dc8547f34c..a574f25d9a9 100644 --- a/Makefile.js +++ b/Makefile.js @@ -562,19 +562,6 @@ target.karma = () => { target.webpack("production"); - const browserFileLintOutput = new CLIEngine({ - useEslintrc: false, - ignore: false, - allowInlineConfig: false, - baseConfig: { parserOptions: { ecmaVersion: 5 } } - }).executeOnFiles([`${BUILD_DIR}/eslint.js`]); - - if (browserFileLintOutput.errorCount > 0) { - echo(`error: Failed to lint ${BUILD_DIR}/eslint.js as ES5 code`); - echo(CLIEngine.getFormatter("stylish")(browserFileLintOutput.results)); - exit(1); - } - const lastReturn = exec(`${getBinFile("karma")} start karma.conf.js`); if (lastReturn.code !== 0) { diff --git a/webpack.config.js b/webpack.config.js index 6a43ac755b7..0c8a0b90554 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -17,9 +17,28 @@ module.exports = { test: /\.m?js$/u, loader: "babel-loader", options: { - presets: ["@babel/preset-env"] + presets: [ + ["@babel/preset-env", { + debug: true, // ← to print actual browser versions + + /* + * We want to remove `transform-unicode-regex` convert because of https://github.com/eslint/eslint/pull/12662. + * + * With `>0.5%`, `@babel/preset-env@7.7.6` prints below: + * + * transform-unicode-regex { "chrome":"49", "ie":"11", "safari":"5.1" } + * + * So this excludes those versions: + * + * - IE 11 + * - Chrome 49 (2016; the last version on Windows XP) + * - Safari 5.1 (2011-2013; the last version on Windows) + */ + targets: ">0.5%, not chrome 49, not ie 11, not safari 5.1" + }] + ] }, - exclude: /node_modules\/lodash/u + exclude: /node_modules[\\/]lodash/u } ] },