Skip to content

Commit

Permalink
Enable replace-array-includes-with-indexof for all bundles (prettie…
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker authored and lydell committed Nov 17, 2019
1 parent b7bcffb commit 56b4ce3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
3 changes: 3 additions & 0 deletions scripts/build/bundler.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ function getBabelConfig(bundle) {
plugins: bundle.babelPlugins || [],
compact: bundle.type === "plugin" ? false : "auto"
};
config.plugins.push(
require.resolve("./babel-plugins/replace-array-includes-with-indexof")
);
if (bundle.type === "core") {
config.plugins.push(
require.resolve("./babel-plugins/transform-custom-require")
Expand Down
10 changes: 2 additions & 8 deletions scripts/build/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

const path = require("path");
const PROJECT_ROOT = path.resolve(__dirname, "../..");
const babelReplaceArrayIncludesWithIndexof = require.resolve(
"./babel-plugins/replace-array-includes-with-indexof"
);

/**
* @typedef {Object} Bundle
Expand All @@ -29,8 +26,7 @@ const babelReplaceArrayIncludesWithIndexof = require.resolve(
const parsers = [
{
input: "src/language-js/parser-babylon.js",
target: "universal",
babelPlugins: [babelReplaceArrayIncludesWithIndexof]
target: "universal"
},
{
input: "src/language-js/parser-flow.js",
Expand All @@ -40,7 +36,6 @@ const parsers = [
{
input: "src/language-js/parser-typescript.js",
target: "universal",
babelPlugins: [babelReplaceArrayIncludesWithIndexof],
replace: {
'require("@microsoft/typescript-etw")': "undefined"
}
Expand Down Expand Up @@ -130,8 +125,7 @@ const parsers = [
replacement: require.resolve("lines-and-columns")
}
]
},
babelPlugins: [babelReplaceArrayIncludesWithIndexof]
}
}
].map(parser => {
const name = getFileOutput(parser)
Expand Down

0 comments on commit 56b4ce3

Please sign in to comment.