Minify build when using lodash and preact-cli
npm install preact-cli-lodashMinify build when using lodash and preact-cli
Install it via npm:
``shell`
npm install preact-cli-lodash
yarn:
`shell`
yarn add preact-cli-lodash --dev
This will install:
- lodash
- lodash-webpack-plugin
- babel-plugin-lodash
And include in your project by creating a preact.config.js
`javascript
const preactCliLodash = require('preact-cli-lodash');
export default function (config) {
preactCliLodash(config);
}
`
If you want to pass options to the lodash-webpack-plugin you can as the second argument of the preactCliLodash function like so:
`javascript
const preactCliLodash = require('preact-cli-lodash');
export default function (config) {
preactCliLodash(config, {
'collections': true,
'paths': true
});
}
``
MIT