diff --git a/scripts/build/build.js b/scripts/build/build.js index dfa89a2ac..7e31110a3 100644 --- a/scripts/build/build.js +++ b/scripts/build/build.js @@ -22,7 +22,7 @@ process.on("unhandledRejection", (err) => { process.exit(1); }); -const CACHE_VERSION = "v27"; // This need update when updating build scripts +const CACHE_VERSION = "v28"; // This need update when updating build scripts const CACHED = chalk.bgYellow.black(" CACHED "); const OK = chalk.bgGreen.black(" DONE "); const FAIL = chalk.bgRed.black(" FAIL "); diff --git a/scripts/build/bundler.js b/scripts/build/bundler.js index 9af07a5b1..be86f766a 100644 --- a/scripts/build/bundler.js +++ b/scripts/build/bundler.js @@ -16,12 +16,8 @@ const nativeShims = require("./rollup-plugins/native-shims"); const executable = require("./rollup-plugins/executable"); const evaluate = require("./rollup-plugins/evaluate"); const externals = require("./rollup-plugins/externals"); -const bundles = require("./config"); const PROJECT_ROOT = path.resolve(__dirname, "../.."); -const plugins = bundles - .filter(({ type }) => type === "plugin") - .map(({ input }) => path.join(PROJECT_ROOT, input)); const EXTERNALS = [ "assert", @@ -178,11 +174,12 @@ function getRollupConfig(bundle) { commonjs({ ignoreGlobal: bundle.target === "node", ...bundle.commonjs, + ignore: + bundle.type === "plugin" + ? undefined + : (id) => /\.\/parser-.*?/.test(id), }), - externals([ - ...(bundle.externals || []), - ...(bundle.type !== "plugin" ? plugins : []), - ]), + externals(bundle.externals), bundle.target === "universal" && nodeGlobals(), babel(babelConfig), bundle.minify !== false && bundle.target === "universal" && terser(),