Skip to content

Commit e536b19

Browse files
committed
chore: Minify parser-postcss
1 parent 43e8eff commit e536b19

3 files changed

Lines changed: 410 additions & 9 deletions

File tree

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
"snapshot-diff": "0.4.0",
114114
"strip-ansi": "4.0.0",
115115
"tempy": "0.2.1",
116+
"terser-webpack-plugin-legacy": "1.2.3",
116117
"webpack": "3.12.0"
117118
},
118119
"scripts": {

scripts/build/bundler.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const execa = require("execa");
44
const path = require("path");
55
const { rollup } = require("rollup");
66
const webpack = require("webpack");
7+
const TerserWebpackPlugin = require("terser-webpack-plugin-legacy");
78
const resolve = require("rollup-plugin-node-resolve");
89
const alias = require("rollup-plugin-alias");
910
const commonjs = require("rollup-plugin-commonjs");
@@ -165,6 +166,7 @@ function getWebpackConfig(bundle) {
165166
}
166167

167168
const root = path.resolve(__dirname, "..", "..");
169+
168170
return {
169171
entry: path.resolve(root, bundle.input),
170172
module: {
@@ -187,8 +189,9 @@ function getWebpackConfig(bundle) {
187189
plugins: [
188190
new webpack.DefinePlugin({
189191
"process.env.NODE_ENV": JSON.stringify("production")
190-
})
191-
]
192+
}),
193+
bundle.type === "plugin" && new TerserWebpackPlugin()
194+
].filter(Boolean)
192195
};
193196
}
194197

0 commit comments

Comments
 (0)