Skip to content

Commit

Permalink
chore(examples): add example with uglifyjs, #1074
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Sep 21, 2018
1 parent 28bab4c commit 972d1eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion examples/all-possible-containers/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
"babel-plugin-transform-react-remove-prop-types": "0.4.13",
"cross-env": "5.1.4",
"html-webpack-plugin": "3.2.0",
"react-hot-loader": "4.1.2",
"react-hot-loader": "4.3.10",
"uglifyjs-webpack-plugin": "^2.0.1",
"webpack": "4.6.0",
"webpack-cli": "2.0.15",
"webpack-serve": "0.3.2"
Expand Down
7 changes: 5 additions & 2 deletions examples/all-possible-containers/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const exclude = absPath => /node_modules/.test(absPath)
const mode = process.env.NODE_ENV || 'development'
const mode = 'production' //process.env.NODE_ENV || 'development'
const production = mode === 'production'

module.exports = {
Expand Down Expand Up @@ -32,12 +33,14 @@ module.exports = {
rules: [
{
test: /\.js$/,
exclude,
exclude: /node_modules/,
use: 'babel-loader',
},
],
},
optimization: {
minimizer: [new UglifyJsPlugin()],

splitChunks: {
cacheGroups: {
commons: {
Expand Down

0 comments on commit 972d1eb

Please sign in to comment.