Skip to content

Commit

Permalink
Minify parser-postcss.js (#11489)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Sep 12, 2021
1 parent 567676c commit 04391a0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 14 additions & 9 deletions scripts/build/bundler.mjs
Expand Up @@ -263,17 +263,22 @@ function getRollupOutputOptions(bundle, buildOptions) {
exports: "auto",
file: path.join(DIST_DIR, bundle.output),
name: bundle.name,
plugins: [
bundle.minify !== false &&
bundle.target === "universal" &&
rollupPluginTerser({
output: {
ascii_only: true,
},
}),
],
plugins: [],
};

if (bundle.minify !== false && bundle.target === "universal") {
let { terserOptions = {} } = bundle;
terserOptions = {
...terserOptions,
output: {
...terserOptions.output,
ascii_only: true,
},
};

options.plugins.push(rollupPluginTerser(terserOptions));
}

if (bundle.target === "node") {
options.format = "cjs";
} else if (bundle.target === "universal") {
Expand Down
2 changes: 0 additions & 2 deletions scripts/build/config.mjs
Expand Up @@ -82,8 +82,6 @@ const parsers = [
file: path.join(dirname, "replacement/colorette.mjs"),
},
},
// TODO[@fisker]: Enable minify
minify: false,
},
{
input: "src/language-graphql/parser-graphql.js",
Expand Down

0 comments on commit 04391a0

Please sign in to comment.