Skip to content

Commit

Permalink
Merge pull request #1326 from mikekidder/reunify.webpack
Browse files Browse the repository at this point in the history
use cross-env for webpack
  • Loading branch information
gaearon committed Jan 31, 2016
2 parents c4d32a4 + dabbb7b commit 89b4f36
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 52 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"test:examples": "babel-node examples/testAll.js",
"check": "npm run lint && npm run test",
"build:lib": "babel src --out-dir lib",
"build:umd": "webpack src/index.js dist/redux.js --config webpack.config.development.js",
"build:umd:min": "webpack src/index.js dist/redux.min.js --config webpack.config.production.js",
"build:umd": "cross-env NODE_ENV=development webpack src/index.js dist/redux.js",
"build:umd:min": "cross-env NODE_ENV=production webpack src/index.js dist/redux.min.js",
"build:examples": "babel-node examples/buildAll.js",
"build": "npm run build:lib && npm run build:umd && npm run build:umd:min",
"preversion": "npm run clean && npm run check",
Expand Down Expand Up @@ -66,6 +66,7 @@
"babel-core": "^5.6.18",
"babel-eslint": "^4.1.0",
"babel-loader": "^5.1.4",
"cross-env": "^1.0.7",
"eslint": "^1.10.3",
"eslint-config-rackt": "^1.1.1",
"eslint-plugin-react": "^3.16.1",
Expand Down
16 changes: 0 additions & 16 deletions webpack.config.base.js

This file was deleted.

14 changes: 0 additions & 14 deletions webpack.config.development.js

This file was deleted.

37 changes: 37 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
'use strict';
var webpack = require('webpack');

var nodeEnv = process.env.NODE_ENV;
var config = {
module: {
loaders: [
{ test: /\.js$/, loaders: ['babel-loader'], exclude: /node_modules/ }
]
},
output: {
library: 'Redux',
libraryTarget: 'umd'
},
resolve: {
extensions: ['', '.js']
},
plugins : [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(nodeEnv)
})
]
};

if (nodeEnv == 'production') {
config.plugins.push(
new webpack.optimize.UglifyJsPlugin({
compressor: {
screw_ie8: true,
warnings: false
}
})
)
}

module.exports = config;
20 changes: 0 additions & 20 deletions webpack.config.production.js

This file was deleted.

0 comments on commit 89b4f36

Please sign in to comment.