Skip to content

Commit

Permalink
feat: use terserJsPlugin for transformations during migrate
Browse files Browse the repository at this point in the history
  • Loading branch information
abenezerabebe authored and sendilkumarn committed Mar 16, 2019
1 parent d467f3b commit 33c6185
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/migrate/__testfixtures__/failing.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const config = {

switch (nodeEnvironment) {
case "production":
config.plugins.push(new webpack.optimize.UglifyJsPlugin());
config.plugins.push(new webpack.optimize.TerserPlugin());
case "preproduction":
config.output.path = __dirname + "/dist";
config.plugins.push(new webpack.optimize.DedupePlugin());
Expand Down
6 changes: 3 additions & 3 deletions packages/migrate/__tests__/__snapshots__/migrate.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module.exports = {
modules: ['node_modules']
},
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.TerserPlugin(),
new webpack.optimize.OccurrenceOrderPlugin()
],
debug: true
Expand Down Expand Up @@ -50,7 +50,7 @@ module.exports = {
modules: ['node_modules']
},
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.TerserPlugin(),
new webpack.optimize.OccurrenceOrderPlugin()
],
debug: true
Expand Down Expand Up @@ -116,7 +116,7 @@ module.exports = {
modules: ['node_modules']
},
plugins: [
new webpack.optimize.UglifyJsPlugin(),
new webpack.optimize.TerserPlugin(),
new webpack.optimize.OccurrenceOrderPlugin()
],
debug: true
Expand Down
6 changes: 3 additions & 3 deletions packages/migrate/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import noEmitOnErrorsPluginTransform from "./noEmitOnErrorsPlugin/noEmitOnErrors
import removeDeprecatedPluginsTransform from "./removeDeprecatedPlugins/removeDeprecatedPlugins";
import removeJsonLoaderTransform from "./removeJsonLoader/removeJsonLoader";
import resolveTransform from "./resolve/resolve";
import terserPluginTransform from "./terserPlugin/terserPlugin";
import { INode } from "./types/NodePath";
import uglifyJsPluginTransform from "./uglifyJsPlugin/uglifyJsPlugin";

interface ITransformsObject {
bannerPluginTransform: object;
Expand All @@ -24,15 +24,15 @@ interface ITransformsObject {
removeDeprecatedPluginsTransform: object;
removeJsonLoaderTransform: object;
resolveTransform: object;
uglifyJsPluginTransform: object;
terserPluginTransform: object;
}

/* tslint:disable object-literal-sort-keys */
const transformsObject: ITransformsObject = {
loadersTransform,
resolveTransform,
removeJsonLoaderTransform,
uglifyJsPluginTransform,
terserPluginTransform,
loaderOptionsPluginTransform,
bannerPluginTransform,
extractTextPluginTransform,
Expand Down

0 comments on commit 33c6185

Please sign in to comment.