gatsby-plugin-lodash
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -12,8 +12,31 @@ "use strict"; | ||
// Add Lodash webpack plugin | ||
exports.modifyWebpackConfig = function (_ref) { | ||
exports.modifyWebpackConfig = function (_ref, _ref2) { | ||
var config = _ref.config, | ||
stage = _ref.stage; | ||
var disabledFeatures = _ref2.disabledFeatures; | ||
if (stage === `build-javascript`) { | ||
config.plugin(`Lodash`, webpackLodashPlugin, null); | ||
var features = { | ||
shorthands: true, | ||
cloning: true, | ||
currying: true, | ||
caching: true, | ||
collections: true, | ||
exotics: true, | ||
guards: true, | ||
metadata: true, | ||
deburring: true, | ||
unicode: true, | ||
chaining: true, | ||
memoizing: true, | ||
coercions: true, | ||
flattening: true, | ||
paths: true, | ||
placeholders: true | ||
}; | ||
disabledFeatures.forEach(function (feature) { | ||
delete features[feature]; | ||
}); | ||
config.plugin(`Lodash`, webpackLodashPlugin, features); | ||
} | ||
@@ -25,4 +48,4 @@ | ||
// Add Lodash Babel plugin | ||
exports.modifyBabelrc = function (_ref2) { | ||
var babelrc = _ref2.babelrc; | ||
exports.modifyBabelrc = function (_ref3) { | ||
var babelrc = _ref3.babelrc; | ||
@@ -29,0 +52,0 @@ return (0, _extends3.default)({}, babelrc, { |
{ | ||
"name": "gatsby-plugin-lodash", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Easy modular Lodash builds. Adds the Lodash webpack & Babel plugins to your Gatsby build", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -19,1 +19,13 @@ # gatsby-plugin-lodash | ||
By default this plugin enables all [feature sets](https://github.com/lodash/lodash-webpack-plugin#feature-sets). If you know you don't need some of them, you can remove support for features sets by setting a `disabledFeatures` option like the following: | ||
```javascript | ||
plugins: [ | ||
{ | ||
resolve: `gatsby-plugin-lodash`, | ||
options: { | ||
disabledFeatures: [`shorthands`, `cloning`] | ||
}, | ||
}, | ||
] | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3284
43
31