Skip to content
This repository was archived by the owner on Feb 16, 2021. It is now read-only.

Commit

Permalink
fix MuiThemeProvider
Browse files Browse the repository at this point in the history
When uglifying with `unused: true` MuiThemeProvider returns
its children as an array instead of an VNode, which makes the
whole element become `undefined`.

mui/material-ui#7721 (comment)
  • Loading branch information
kontrollanten committed Feb 28, 2018
1 parent c3f2853 commit 2f211a3
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion webpack.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import autoprefixer from 'autoprefixer';
import CopyWebpackPlugin from 'copy-webpack-plugin';
import path from 'path';
const ENV = process.env.NODE_ENV || 'development';
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
require('dotenv').config();

const CSS_MAPS = ENV !== 'production';
Expand Down Expand Up @@ -36,7 +37,38 @@ module.exports = {
},

optimization: {
minimize: ENV === 'production',
minimizer: [
new UglifyJSPlugin({
uglifyOptions: {
output: {
comments: false
},
compress: {
unsafe_comps: true,
properties: true,
keep_fargs: false,
pure_getters: true,
collapse_vars: true,
unsafe: true,
ie8: false,
warnings: false,
sequences: true,
dead_code: true,
drop_debugger: true,
comparisons: true,
conditionals: true,
evaluate: true,
booleans: true,
loops: true,
unused: false,
hoist_funs: true,
if_return: true,
join_vars: true,
drop_console: true
}
}
}),
]
},

module: {
Expand Down

0 comments on commit 2f211a3

Please sign in to comment.