-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use lodash v4 #611
Use lodash v4 #611
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
'use strict'; | ||
|
||
var _ = require('lodash'); | ||
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; | ||
module.exports = _.merge({}, baseConfig, { | ||
plugins: baseConfig.plugins.concat( | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': '"development"' | ||
}) | ||
) | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,22 @@ | ||
'use strict'; | ||
|
||
var _ = require('lodash'); | ||
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; | ||
module.exports = _.merge({}, baseConfig, { | ||
plugins: baseConfig.plugins.concat( | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': '"production"' | ||
}), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using |
||
new webpack.optimize.UglifyJsPlugin({ | ||
compressor: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added more uglify options to crunch it more :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh good. I was always curious what you referred to in some older tweet about not going all the way with Uglify. :-) |
||
pure_getters: true, | ||
unsafe: true, | ||
unsafe_comps: true, | ||
screw_ie8: true, | ||
warnings: false | ||
} | ||
}) | ||
) | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
_.merge
here instead ofObject.create(baseConfig)
because theObject.create
route doesn't clone object references so changes to them change thebaseConfig
properties.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍