Skip to content

Commit

Permalink
chore: replace instances of uglify with terser
Browse files Browse the repository at this point in the history
  • Loading branch information
abenezerabebe authored and sendilkumarn committed Mar 16, 2019
1 parent b1cf4cc commit f9cb8ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/generators/init-generator.ts
Expand Up @@ -43,7 +43,7 @@ export default class InitGenerator extends Generator {
this.dependencies = [
"webpack",
"webpack-cli",
"uglifyjs-webpack-plugin",
"terser-webpack-plugin",
"babel-plugin-syntax-dynamic-import",
];
this.configuration = {
Expand Down Expand Up @@ -430,12 +430,12 @@ export default class InitGenerator extends Generator {
public installPlugins() {
if (this.isProd) {
this.dependencies = this.dependencies.filter(
(p: string) => p !== "uglifyjs-webpack-plugin",
(p: string) => p !== "terser-webpack-plugin",
);
} else {
this.configuration.config.topScope.push(
tooltip.uglify(),
"const UglifyJSPlugin = require('uglifyjs-webpack-plugin');",
"const TerserPlugin = require('terser-webpack-plugin');",
"\n",
);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/generators/utils/plugins.ts
Expand Up @@ -3,9 +3,9 @@
* Callable function with the initial plugins
*
* @returns {Function} An function that returns an array
* that consists of the uglify plugin
* that consists of terser-webpack-plugin
*/

export default function(_?: void): string[] {
return ["new UglifyJSPlugin()"];
return ["new TerserPlugin()"];
}

0 comments on commit f9cb8ce

Please sign in to comment.