@@ -11,10 +11,10 @@ import { IJSCodeshift, INode } from "../types/NodePath";
11
11
/**
12
12
*
13
13
* Transform which:
14
- * Removes UglifyWebpackPlugin from plugins array, if no options is passed to the plugin.
14
+ * Removes TerserWebpackPlugin from plugins array, if no options is passed to the plugin.
15
15
* and adds `optimization.minimize: true` to config
16
16
*
17
- * If any configuration is passed to UglifyWebpackPlugin
17
+ * If any configuration is passed to TerserWebpackPlugin
18
18
* plugin instantiation is moved to `optimization.minimizer`.
19
19
*
20
20
* @param {Object } j - jscodeshift top-level import
@@ -54,7 +54,7 @@ export default function(j: IJSCodeshift, ast: INode): INode {
54
54
const pluginOptions : INode [ ] = node . value . arguments ;
55
55
56
56
/**
57
- * check if there are any options passed to UglifyWebpackPlugin
57
+ * check if there are any options passed to TerserWebpackPlugin
58
58
* If so, they are moved to optimization.minimizer.
59
59
* Otherwise, rely on default options
60
60
*/
@@ -63,11 +63,11 @@ export default function(j: IJSCodeshift, ast: INode): INode {
63
63
* If user is using TerserPlugin directly from webpack
64
64
* transformation must:
65
65
* - remove it
66
- * - add require for uglify -webpack-plugin
66
+ * - add require for terser -webpack-plugin
67
67
* - add to minimizer
68
68
*/
69
69
if ( pluginVariableAssignment && pluginVariableAssignment . includes ( "webpack" ) ) {
70
- // create require for uglify -webpack-plugin
70
+ // create require for terser -webpack-plugin
71
71
const pathRequire : INode = getRequire (
72
72
j ,
73
73
"TerserPlugin" ,
@@ -118,7 +118,7 @@ export default function(j: IJSCodeshift, ast: INode): INode {
118
118
) ;
119
119
}
120
120
121
- // remove the old Uglify plugin from Plugins array.
121
+ // remove the old Terser plugin from Plugins array.
122
122
j ( node ) . remove ( ) ;
123
123
} ) ;
124
124
0 commit comments