Skip to content

Commit

Permalink
chore: upgrade to webpack 4.5.0, remove now built-in plugins, use opt…
Browse files Browse the repository at this point in the history
…imize
  • Loading branch information
efloden committed Apr 5, 2018
1 parent 9c75cce commit 1f18b5f
Show file tree
Hide file tree
Showing 3 changed files with 270 additions and 8 deletions.
6 changes: 3 additions & 3 deletions server/zanata-frontend/src/package.json
Expand Up @@ -12,8 +12,8 @@
"preinstall": "node -e \"if(process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('You must use Yarn to install, not NPM')\"",
"check": "node scripts/check-engines",
"js": "yarn run check && webpack",
"build": "yarn run check && node scripts/build",
"draft": "yarn run check && node scripts/build --draft",
"build": "yarn run check && node scripts/build --mode production",
"draft": "yarn run check && node scripts/build --draft --mode development",
"extract-messages": "yarn run check && node scripts/extract-messages",
"watch": "yarn run check && node scripts/dev-server",
"watch:editor": "yarn run check && node scripts/dev-server --editor",
Expand Down Expand Up @@ -138,7 +138,7 @@
"tslint": "^5.9.1",
"tslint-loader": "^3.5.3",
"typescript": "^2.7.1",
"webpack": "3.10.0",
"webpack": "4.5.0",
"webpack-dev-server": "2.11.0",
"webpack-manifest-plugin": "1.3.2",
"webpack-merge": "4.1.1"
Expand Down
12 changes: 11 additions & 1 deletion server/zanata-frontend/src/webpack.config.js
Expand Up @@ -258,7 +258,7 @@ module.exports = function (env, isEditor, devServerPort) {
// storybook should use the fallback: style-loader
disable: storybook || dev
}),
new webpack.NoEmitOnErrorsPlugin(),
// new webpack.NoEmitOnErrorsPlugin(),

prod
? new webpack.optimize.UglifyJsPlugin({ sourceMap: true })
Expand Down Expand Up @@ -301,6 +301,16 @@ module.exports = function (env, isEditor, devServerPort) {
new ManifestPlugin()
]),

optimization: {
// namedModules: true, // NamedModulesPlugin()
splitChunks: { // CommonsChunkPlugin()
name: 'vendor',
minChunks: 2
},
noEmitOnErrors: true // NoEmitOnErrorsPlugin
// concatenateModules: true // ModuleConcatenationPlugin
},

resolve: {
/* Subdirectories to check while searching up tree for module
* Default is ['', '.js'] */
Expand Down

0 comments on commit 1f18b5f

Please sign in to comment.