Always set parser bundle target to universal (#7455)

* Always set parser bundle target to `universal`

* Allow override
This commit is contained in:
fisker Cheung authored and GitHub committed 2020-01-29 12:45:57 +03:00
1 parent 52cc26e5af
commit e4e1b3ec5b
1 file changed
+7 -16
+7 -16
View File
@@ -25,24 +25,20 @@ const PROJECT_ROOT = path.resolve(__dirname, "../..");
/** @type {Bundle[]} */
const parsers = [
{
input: "src/language-js/parser-babylon.js",
target: "universal"
input: "src/language-js/parser-babylon.js"
},
{
input: "src/language-js/parser-flow.js",
target: "universal",
strict: false
},
{
input: "src/language-js/parser-typescript.js",
target: "universal",
replace: {
'require("@microsoft/typescript-etw")': "undefined"
}
},
{
input: "src/language-js/parser-angular.js",
target: "universal",
alias: {
// Force using the CJS file, instead of ESM; i.e. get the file
// from `"main"` instead of `"module"` (rollup default) of package.json
@@ -62,7 +58,6 @@ const parsers = [
},
{
input: "src/language-css/parser-postcss.js",
target: "universal",
// postcss has dependency cycles that don't work with rollup
bundler: "webpack",
terserOptions: {
@@ -79,16 +74,13 @@ const parsers = [
}
},
{
input: "src/language-graphql/parser-graphql.js",
target: "universal"
input: "src/language-graphql/parser-graphql.js"
},
{
input: "src/language-markdown/parser-markdown.js",
target: "universal"
input: "src/language-markdown/parser-markdown.js"
},
{
input: "src/language-handlebars/parser-glimmer.js",
target: "universal",
alias: {
entries: [
// `handlebars` causes webpack warning by using `require.extensions`
@@ -115,12 +107,10 @@ const parsers = [
}
},
{
input: "src/language-html/parser-html.js",
target: "universal"
input: "src/language-html/parser-html.js"
},
{
input: "src/language-yaml/parser-yaml.js",
target: "universal",
alias: {
// Force using the CJS file, instead of ESM; i.e. get the file
// from `"main"` instead of `"module"` (rollup default) of package.json
@@ -133,11 +123,12 @@ const parsers = [
}
}
].map(parser => ({
...parser,
type: "plugin",
target: "universal",
name: getFileOutput(parser)
.replace(/\.js$/, "")
.split("-")[1]
.split("-")[1],
...parser
}));
/** @type {Bundle[]} */