Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Build: compile deps to ES5 when generating browser file (fixes #11504) (
#11505)

* Build: compile deps to ES5 when generating browser file (fixes #11504)

* Don't compile lodash
  • Loading branch information
not-an-aardvark authored and aladdin-add committed Mar 15, 2019
1 parent 06fa165 commit 5fdb4d3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
19 changes: 16 additions & 3 deletions Makefile.js
Expand Up @@ -25,7 +25,8 @@ const lodash = require("lodash"),
semver = require("semver"),
ejs = require("ejs"),
loadPerf = require("load-perf"),
yaml = require("js-yaml");
yaml = require("js-yaml"),
CLIEngine = require("./lib/cli-engine");

const { cat, cd, cp, echo, exec, exit, find, ls, mkdir, pwd, rm, test } = require("shelljs");

Expand Down Expand Up @@ -440,8 +441,7 @@ function lintMarkdown(files) {
* @returns {Object} Output from each formatter
*/
function getFormatterResults() {
const CLIEngine = require("./lib/cli-engine"),
stripAnsi = require("strip-ansi");
const stripAnsi = require("strip-ansi");

const formatterFiles = fs.readdirSync("./lib/formatters/"),
cli = new CLIEngine({
Expand Down Expand Up @@ -580,6 +580,19 @@ target.test = function() {

target.webpack();

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));
errors++;
}

lastReturn = exec(`${getBinFile("karma")} start karma.conf.js`);
if (lastReturn.code !== 0) {
errors++;
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.js
Expand Up @@ -15,12 +15,12 @@ module.exports = {
module: {
rules: [
{
test: /\.js$/u,
test: /\.m?js$/u,
loader: "babel-loader",
options: {
presets: ["@babel/preset-env"]
},
exclude: /node_modules/u
exclude: /node_modules\/lodash/u
}
]
},
Expand Down

0 comments on commit 5fdb4d3

Please sign in to comment.