Skip to content

Commit c3fe3ee

Browse files
committed
Merge pull request #611 from jdalton/lodash
Use lodash v4
2 parents 18b47c5 + 33a228c commit c3fe3ee

8 files changed

+33
-75
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
},
6060
"homepage": "http://rackt.github.io/redux",
6161
"dependencies": {
62+
"lodash": "^4.1.0",
6263
"loose-envify": "^1.1.0"
6364
},
6465
"devDependencies": {

src/combineReducers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ActionTypes } from './createStore'
2-
import isPlainObject from './utils/isPlainObject'
2+
import isPlainObject from 'lodash/isPlainObject'
33
import warning from './utils/warning'
44

55
function getUndefinedStateErrorMessage(key, action) {

src/createStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import isPlainObject from './utils/isPlainObject'
1+
import isPlainObject from 'lodash/isPlainObject'
22

33
/**
44
* These are private action types reserved by Redux.

src/utils/isPlainObject.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

test/utils/isPlainObject.spec.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

webpack.config.base.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
'use strict';
22

3+
var webpack = require('webpack');
4+
35
module.exports = {
46
module: {
57
loaders: [
@@ -10,7 +12,7 @@ module.exports = {
1012
library: 'Redux',
1113
libraryTarget: 'umd'
1214
},
13-
resolve: {
14-
extensions: ['', '.js']
15-
}
15+
plugins: [
16+
new webpack.optimize.OccurenceOrderPlugin()
17+
]
1618
};

webpack.config.development.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
'use strict';
22

3+
var _ = require('lodash');
34
var webpack = require('webpack');
45
var baseConfig = require('./webpack.config.base');
56

6-
var config = Object.create(baseConfig);
7-
config.plugins = [
8-
new webpack.optimize.OccurenceOrderPlugin(),
9-
new webpack.DefinePlugin({
10-
'process.env.NODE_ENV': JSON.stringify('development')
11-
})
12-
];
13-
14-
module.exports = config;
7+
module.exports = _.merge({}, baseConfig, {
8+
plugins: baseConfig.plugins.concat(
9+
new webpack.DefinePlugin({
10+
'process.env.NODE_ENV': '"development"'
11+
})
12+
)
13+
});

webpack.config.production.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
'use strict';
22

3+
var _ = require('lodash');
34
var webpack = require('webpack');
45
var baseConfig = require('./webpack.config.base');
56

6-
var config = Object.create(baseConfig);
7-
config.plugins = [
8-
new webpack.optimize.OccurenceOrderPlugin(),
9-
new webpack.DefinePlugin({
10-
'process.env.NODE_ENV': JSON.stringify('production')
11-
}),
12-
new webpack.optimize.UglifyJsPlugin({
13-
compressor: {
14-
screw_ie8: true,
15-
warnings: false
16-
}
17-
})
18-
];
19-
20-
module.exports = config;
7+
module.exports = _.merge({}, baseConfig, {
8+
plugins: baseConfig.plugins.concat(
9+
new webpack.DefinePlugin({
10+
'process.env.NODE_ENV': '"production"'
11+
}),
12+
new webpack.optimize.UglifyJsPlugin({
13+
compressor: {
14+
pure_getters: true,
15+
unsafe: true,
16+
unsafe_comps: true,
17+
screw_ie8: true,
18+
warnings: false
19+
}
20+
})
21+
)
22+
});

0 commit comments

Comments
 (0)