Skip to content

Instantly share code, notes, and snippets.

@gdborton
Last active February 13, 2018 20:50
Show Gist options
  • Save gdborton/77d1cc9b03b85e199e7dc02bc8afb89d to your computer and use it in GitHub Desktop.
Save gdborton/77d1cc9b03b85e199e7dc02bc8afb89d to your computer and use it in GitHub Desktop.
200KB exploration
import ReactDOM from 'react-dom';
const path = require('path');
const webpack = require('webpack');
module.exports = {
entry: path.resolve('src/index.js'),
output: {
filename: 'index.js',
path: path.resolve('dist'),
},
plugins: [
new webpack.optimize.UglifyJsPlugin({}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production'),
})
]
}
@gdborton
Copy link
Author

I wouldn't expect DefinePlugin order to matter, I imagine they operate on different hooks. Tested order locally and it didn't affect size.

Updating w/ JSON.stringify got us down to ~100KB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment