Skip to content

Commit

Permalink
script build windows compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mikekidder committed Aug 28, 2015
1 parent d0f9553 commit bfd578d
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 49 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
node_modules
webpack.config*.js
node_modules
12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
"url": "https://github.com/erikras/redux-form"
},
"scripts": {
"browser": "scripts/browser",
"build": "scripts/build",
"clean": "scripts/clean",
"lint": "scripts/lint",
"prepublish": "scripts/prepublish"
"build": "npm run build:lib && npm run build:umd && npm run build:umd:min",
"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",
"clean": "rimraf dist lib",
"lint": "eslint src",
"prepublish": "npm run lint && npm run clean && npm run build"
},
"keywords": [
"react",
Expand Down
8 changes: 0 additions & 8 deletions scripts/browser

This file was deleted.

4 changes: 0 additions & 4 deletions scripts/build

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/clean

This file was deleted.

3 changes: 0 additions & 3 deletions scripts/lint

This file was deleted.

6 changes: 0 additions & 6 deletions scripts/prepublish

This file was deleted.

20 changes: 1 addition & 19 deletions webpack.config.js → webpack.config.base.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,5 @@
'use strict';
var webpack = require('webpack');
var plugins = [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
}),
new webpack.optimize.OccurenceOrderPlugin()
];

if (process.env.NODE_ENV === 'production') {
plugins.push(
new webpack.optimize.UglifyJsPlugin({
compressor: {
screw_ie8: true,
warnings: false
}
})
);
}

var reactExternal = {
root: 'React',
Expand All @@ -38,8 +21,7 @@ module.exports = {
library: 'ReduxForm',
libraryTarget: 'umd'
},
plugins: plugins,
resolve: {
extensions: ['', '.js']
}
};
};
15 changes: 15 additions & 0 deletions webpack.config.development.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict';

var webpack = require('webpack');
var baseConfig = require('./webpack.config.base');

var config = Object.create(baseConfig);
config.plugins = [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development')
})

];

module.exports = config;
20 changes: 20 additions & 0 deletions webpack.config.production.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
'use strict';

var webpack = require('webpack');
var baseConfig = require('./webpack.config.base');

var config = Object.create(baseConfig);
config.plugins = [
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('production')
}),
new webpack.optimize.UglifyJsPlugin({
compressor: {
screw_ie8: true,
warnings: false
}
})
];

module.exports = config;

0 comments on commit bfd578d

Please sign in to comment.