Separate webackconfig for prod

This commit is contained in:
Jordan Eldredge 2016-08-01 21:47:30 -07:00
parent bc1ffb29c3
commit a5cbc6f848
3 changed files with 15 additions and 10 deletions

View file

@ -5,7 +5,7 @@
"main": "index.html",
"scripts": {
"lint": "eslint js/*.js js/*.jsx",
"build": "webpack --optimize-minimize",
"build": "webpack --config=webpack.production.config.js",
"serve": "webpack-dev-server",
"weight": "npm run build && gzip-size built/winamp.js | pretty-bytes",
"test": "jest && npm run lint",

View file

@ -1,14 +1,6 @@
var path = require('path');
var webpack = require('webpack');
const path = require('path');
module.exports = {
plugins: [
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
})
],
module: {
loaders: [
{

View file

@ -0,0 +1,13 @@
const config = require('./webpack.config');
const webpack = require('webpack');
config.plugins = (config.plugins || []).concat([
new webpack.DefinePlugin({
'process.env': {
'NODE_ENV': JSON.stringify('production')
}
}),
new webpack.optimize.UglifyJsPlugin()
]);
module.exports = config;