Skip to content

Commit

Permalink
Build: update browser build (#12693)
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea authored and kaicataldo committed Dec 23, 2019
1 parent 00ddfff commit 4e16957
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
13 changes: 0 additions & 13 deletions Makefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
23 changes: 21 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
},
Expand Down

0 comments on commit 4e16957

Please sign in to comment.