Skip to content

Instantly share code, notes, and snippets.

@nairihar
Last active July 20, 2018 19:59
Show Gist options
  • Save nairihar/90359844f85bc18f42a1319b1a57df64 to your computer and use it in GitHub Desktop.
Save nairihar/90359844f85bc18f42a1319b1a57df64 to your computer and use it in GitHub Desktop.
Setup React App - Organizing React Application Part 1
const webpack = require('webpack');
const merge = require('webpack-merge');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
const common = require('./webpack.common.js');
module.exports = merge(common, {
mode: 'production',
plugins: [
new webpack.SourceMapDevToolPlugin({
filename: '[name].js.map',
exclude: ['bundle.js']
}),
new UglifyJSPlugin({
sourceMap: true
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
})
]
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment