Skip to content

Commit 1cb2c57

Browse files
author
Fabian Gander
committed
Improving lodash bundling.
1 parent e5cc5b5 commit 1cb2c57

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

.babelrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"presets": ["es2015", "react"]
2+
"presets": ["es2015", "react"],
3+
"plugins": ["lodash"]
34
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
"babel-core": "^6.25.0",
5252
"babel-eslint": "^7.2.3",
5353
"babel-loader": "^7.1.1",
54+
"babel-plugin-lodash": "^3.3.4",
5455
"babel-polyfill": "^6.23.0",
5556
"babel-preset-es2015": "^6.24.1",
5657
"babel-preset-react": "^6.24.1",
@@ -65,6 +66,7 @@
6566
"eslint-plugin-react": "^7.0.1",
6667
"husky": "^0.13.3",
6768
"jsdom": "^9.12.0",
69+
"lodash-webpack-plugin": "^0.11.5",
6870
"mocha": "^3.4.2",
6971
"nyc": "^11.0.2",
7072
"react-addons-test-utils": "^15.6.2",

webpack.config.prod.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const path = require('path');
22
const CleanWebpackPlugin = require('clean-webpack-plugin');
33
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
4+
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
45
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
56

67
module.exports = {
@@ -18,6 +19,7 @@ module.exports = {
1819
},
1920
plugins: [
2021
new CleanWebpackPlugin(['dist']),
22+
new LodashModuleReplacementPlugin(),
2123
new UglifyJsPlugin({
2224
comments: false,
2325
}),

0 commit comments

Comments
 (0)