Skip to content

Commit

Permalink
docs: replace Uglify with Terser in comments
Browse files Browse the repository at this point in the history
  • Loading branch information
abenezerabebe authored and sendilkumarn committed Mar 16, 2019
1 parent 14f5337 commit 799577d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/migrate/terserPlugin/terserPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import { IJSCodeshift, INode } from "../types/NodePath";
/**
*
* Transform which:
* Removes UglifyWebpackPlugin from plugins array, if no options is passed to the plugin.
* Removes TerserWebpackPlugin from plugins array, if no options is passed to the plugin.
* and adds `optimization.minimize: true` to config
*
* If any configuration is passed to UglifyWebpackPlugin
* If any configuration is passed to TerserWebpackPlugin
* plugin instantiation is moved to `optimization.minimizer`.
*
* @param {Object} j - jscodeshift top-level import
Expand Down Expand Up @@ -54,7 +54,7 @@ export default function(j: IJSCodeshift, ast: INode): INode {
const pluginOptions: INode[] = node.value.arguments;

/**
* check if there are any options passed to UglifyWebpackPlugin
* check if there are any options passed to TerserWebpackPlugin
* If so, they are moved to optimization.minimizer.
* Otherwise, rely on default options
*/
Expand All @@ -63,11 +63,11 @@ export default function(j: IJSCodeshift, ast: INode): INode {
* If user is using TerserPlugin directly from webpack
* transformation must:
* - remove it
* - add require for uglify-webpack-plugin
* - add require for terser-webpack-plugin
* - add to minimizer
*/
if (pluginVariableAssignment && pluginVariableAssignment.includes("webpack")) {
// create require for uglify-webpack-plugin
// create require for terser-webpack-plugin
const pathRequire: INode = getRequire(
j,
"TerserPlugin",
Expand Down Expand Up @@ -118,7 +118,7 @@ export default function(j: IJSCodeshift, ast: INode): INode {
);
}

// remove the old Uglify plugin from Plugins array.
// remove the old Terser plugin from Plugins array.
j(node).remove();
});

Expand Down

0 comments on commit 799577d

Please sign in to comment.