Skip to content
This repository has been archived by the owner on May 17, 2019. It is now read-only.

Remove uglify plugin from webpack config #304

Merged
merged 2 commits into from
Mar 28, 2018
Merged
Changes from 1 commit
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
16 changes: 3 additions & 13 deletions build/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const ProgressBarPlugin = require('progress-bar-webpack-plugin');
const WebpackChunkHash = require('webpack-chunk-hash');
const webpackDevMiddleware = require('../lib/simple-webpack-dev-middleware');
const ChunkManifestPlugin = require('./external-chunk-manifest-plugin.js');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to remove this from the package.json too 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point

const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');
const {
//zopfliWebpackPlugin,
Expand Down Expand Up @@ -414,9 +413,9 @@ function getConfig({target, env, dir, watch, cover}) {
// See https://github.com/webpack/webpack/issues/1315 and
// https://webpack.js.org/guides/caching/#generating-unique-hashes-for-each-file
// Use deterministic, internal webpack identifiers based on hashed contents
env === 'production' && target === 'web'
? new webpack.HashedModuleIdsPlugin()
: new webpack.NamedModulesPlugin(),
env === 'production' &&
target === 'web' &&
new webpack.HashedModuleIdsPlugin(),
// Adds md5 hashing of webpack chunks
env === 'production' && target === 'web' && new WebpackChunkHash(),
// This is necessary to tell webpack not to inline code referencing
Expand Down Expand Up @@ -469,15 +468,6 @@ function getConfig({target, env, dir, watch, cover}) {
banner: nodeEnvBanner,
}),
new webpack.EnvironmentPlugin({NODE_ENV: nodeEnv}),
target !== 'node' &&
env === 'production' &&
new UglifyJSPlugin({
// TODO(#12): Investigate if these options are still required - they are causing production builds to fail
// compress: {warnings: false},
// mangle: true,
// output: {comments: false},
sourceMap: true,
}),
].filter(Boolean),
optimization: {
sideEffects: true,
Expand Down