Neutrino middleware that automatically enables necessary source maps in development and production
- Human-readable chunk names
- Vendor modules chunks
- Dynamic imports chunks
- Shared modules chunks
- Max size chunks splitting
- JS minification
- CSS minification
- Performance warnings on production only
- Node.js v10+
- Neutrino v9
- Webpack v4
@constgen/neutrino-optimization
can be installed from NPM. You should install it to "dependencies"
(--save) or "devDependncies"
(--save-dev) depending on your goal.
npm install --save @constgen/neutrino-optimization
Require this package and plug it into Neutrino. The following shows how you can pass an options object to the middleware, showing the defaults:
let optimization = require('@constgen/neutrino-optimization')
neutrino.use(optimization({
chunks : true, // enable chunks optimization splitting
minimize: true // enable code minification
}))
The middleware also may be used together with another presets in Neutrino rc-file, e.g.:
.neutrinorc.js
let optimization = require('@constgen/neutrino-optimization')
module.exports = {
use: [
optimization()
]
}