Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to UglifyJS that supports ES6 and up #2530

Merged
merged 2 commits into from
Dec 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"shelljs": "^0.7.8",
"style-loader": "^0.18.2",
"ts-loader": "^2.2.2",
"uglifyjs-webpack-plugin": "^1.1.4",
"url-loader": "^0.5.8",
"util-deprecate": "^1.0.2",
"uuid": "^3.1.0",
Expand Down
18 changes: 10 additions & 8 deletions app/angular/src/server/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import path from 'path';
import webpack from 'webpack';
import UglifyJsPlugin from 'uglifyjs-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';

import babelLoaderConfig from './babel.prod';
import { getConfigDir, includePaths, excludePaths, loadEnv, nodePaths } from './utils';
import { getPreviewHeadHtml, getManagerHeadHtml } from '../utils';
Expand Down Expand Up @@ -44,15 +46,15 @@ export default function() {
template: require.resolve('../iframe.html.ejs'),
}),
new webpack.DefinePlugin(loadEnv({ production: true })),
new webpack.optimize.UglifyJsPlugin({
compress: {
screw_ie8: true,
new UglifyJsPlugin({
parallel: true,
uglifyOptions: {
ie8: false,
mangle: false,
warnings: false,
},
mangle: false,
output: {
comments: false,
screw_ie8: true,
output: {
comments: false,
},
},
}),
new webpack.ContextReplacementPlugin(
Expand Down
1 change: 1 addition & 0 deletions app/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"react-native-iphone-x-helper": "^1.0.1",
"shelljs": "^0.7.8",
"style-loader": "^0.19.1",
"uglifyjs-webpack-plugin": "^1.1.4",
"url-loader": "^0.6.2",
"url-parse": "^1.1.9",
"util-deprecate": "^1.0.2",
Expand Down
19 changes: 9 additions & 10 deletions app/react-native/src/server/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import webpack from 'webpack';
import UglifyJsPlugin from 'uglifyjs-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import { OccurenceOrderPlugin, includePaths, excludePaths } from './utils';

Expand Down Expand Up @@ -30,17 +31,15 @@ const getConfig = options => {
}),
new webpack.DefinePlugin({ 'process.env.NODE_ENV': '"production"' }),
new webpack.optimize.DedupePlugin(),
new webpack.optimize.UglifyJsPlugin({
compress: {
screw_ie8: true,
new UglifyJsPlugin({
parallel: true,
uglifyOptions: {
ie8: false,
mangle: false,
warnings: false,
},
mangle: {
screw_ie8: true,
},
output: {
comments: false,
screw_ie8: true,
output: {
comments: false,
},
},
}),
],
Expand Down
1 change: 1 addition & 0 deletions app/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
"serve-favicon": "^2.4.5",
"shelljs": "^0.7.8",
"style-loader": "^0.19.1",
"uglifyjs-webpack-plugin": "^1.1.4",
"url-loader": "^0.6.2",
"util-deprecate": "^1.0.2",
"uuid": "^3.1.0",
Expand Down
18 changes: 10 additions & 8 deletions app/react/src/server/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import path from 'path';
import webpack from 'webpack';
import UglifyJsPlugin from 'uglifyjs-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';

import babelLoaderConfig from './babel.prod';
import { getConfigDir, includePaths, excludePaths, loadEnv, nodePaths } from './utils';
import { getPreviewHeadHtml, getManagerHeadHtml } from '../utils';
Expand Down Expand Up @@ -44,15 +46,15 @@ export default function() {
template: require.resolve('../iframe.html.ejs'),
}),
new webpack.DefinePlugin(loadEnv({ production: true })),
new webpack.optimize.UglifyJsPlugin({
compress: {
screw_ie8: true,
new UglifyJsPlugin({
parallel: true,
uglifyOptions: {
ie8: false,
mangle: false,
warnings: false,
},
mangle: false,
output: {
comments: false,
screw_ie8: true,
output: {
comments: false,
},
},
}),
],
Expand Down
1 change: 1 addition & 0 deletions app/vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"serve-favicon": "^2.4.5",
"shelljs": "^0.7.8",
"style-loader": "^0.19.1",
"uglifyjs-webpack-plugin": "^1.1.4",
"url-loader": "^0.6.2",
"util-deprecate": "^1.0.2",
"uuid": "^3.1.0",
Expand Down
18 changes: 10 additions & 8 deletions app/vue/src/server/config/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import path from 'path';
import webpack from 'webpack';
import UglifyJsPlugin from 'uglifyjs-webpack-plugin';
import HtmlWebpackPlugin from 'html-webpack-plugin';

import babelLoaderConfig from './babel.prod';
import { getConfigDir, includePaths, excludePaths, loadEnv, nodePaths } from './utils';
import { getPreviewHeadHtml, getManagerHeadHtml } from '../utils';
Expand Down Expand Up @@ -44,15 +46,15 @@ export default function() {
template: require.resolve('../iframe.html.ejs'),
}),
new webpack.DefinePlugin(loadEnv({ production: true })),
new webpack.optimize.UglifyJsPlugin({
compress: {
screw_ie8: true,
new UglifyJsPlugin({
parallel: true,
uglifyOptions: {
ie8: false,
mangle: false,
warnings: false,
},
mangle: false,
output: {
comments: false,
screw_ie8: true,
output: {
comments: false,
},
},
}),
],
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13661,7 +13661,7 @@ uglifyjs-webpack-plugin@^0.4.6:
uglify-js "^2.8.29"
webpack-sources "^1.0.1"

uglifyjs-webpack-plugin@~1.1.2:
uglifyjs-webpack-plugin@^1.1.4, uglifyjs-webpack-plugin@~1.1.2:
version "1.1.4"
resolved "https://registry.yarnpkg.com/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.1.4.tgz#e43ad6e736c315024eb99481a7cc9362d6a066be"
dependencies:
Expand Down