From e4e1b3ec5b37a62efe136943fa39a70bbff13db6 Mon Sep 17 00:00:00 2001 From: fisker Cheung Date: Wed, 29 Jan 2020 17:45:57 +0800 Subject: [PATCH] Always set parser bundle target to `universal` (#7455) * Always set parser bundle target to `universal` * Allow override --- scripts/build/config.js | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/scripts/build/config.js b/scripts/build/config.js index b5161b643..c889f89e2 100644 --- a/scripts/build/config.js +++ b/scripts/build/config.js @@ -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[]} */