Minor tweaks for build configs (#6663)

* Minor tweaks for build configs

* fix `@angular/compiler` path
master
fisker Cheung 2019-10-16 13:08:30 +08:00 committed by Simon Lydell
parent b5cc13a5df
commit d52021ecbf
1 changed files with 11 additions and 12 deletions

View File

@ -2,6 +2,9 @@
const path = require("path");
const PROJECT_ROOT = path.resolve(__dirname, "../..");
const babelReplaceArrayIncludesWithIndexof = require.resolve(
"./babel-plugins/replace-array-includes-with-indexof"
);
/**
* @typedef {Object} Bundle
@ -27,9 +30,7 @@ const parsers = [
{
input: "src/language-js/parser-babylon.js",
target: "universal",
babelPlugins: [
require.resolve("./babel-plugins/replace-array-includes-with-indexof")
]
babelPlugins: [babelReplaceArrayIncludesWithIndexof]
},
{
input: "src/language-js/parser-flow.js",
@ -39,9 +40,7 @@ const parsers = [
{
input: "src/language-js/parser-typescript.js",
target: "universal",
babelPlugins: [
require.resolve("./babel-plugins/replace-array-includes-with-indexof")
],
babelPlugins: [babelReplaceArrayIncludesWithIndexof],
commonjs: {
ignore: [
// Optional package for TypeScript that logs ETW events (a Windows-only technology).
@ -106,8 +105,10 @@ const parsers = [
},
commonjs: {
namedExports: {
"node_modules/handlebars/dist/cjs/handlebars.js": ["parse"],
"node_modules/@glimmer/syntax/dist/modules/es2017/index.js": "default"
[require.resolve("handlebars/dist/cjs/handlebars.js")]: ["parse"],
[require.resolve(
"@glimmer/syntax/dist/modules/es2017/index.js"
)]: "default"
},
ignore: ["source-map"]
}
@ -129,9 +130,7 @@ const parsers = [
}
]
},
babelPlugins: [
require.resolve("./babel-plugins/replace-array-includes-with-indexof")
]
babelPlugins: [babelReplaceArrayIncludesWithIndexof]
}
].map(parser => {
const name = getFileOutput(parser)
@ -191,4 +190,4 @@ function getFileOutput(bundle) {
module.exports = coreBundles
.concat(parsers)
.map(b => Object.assign(b, { output: getFileOutput(b) }));
.map(bundle => Object.assign(bundle, { output: getFileOutput(bundle) }));