Neutrino Minify Middleware

NPM version NPM downloads Join Slack

neutrino-middleware-minify is Neutrino middleware for minifying source code using BabiliWebpackPlugin. This middleware is usually only added during production builds.


  • Node.js v6.10+
  • Yarn or npm client
  • Neutrino v6


neutrino-middleware-minify can be installed via the Yarn or npm clients.


❯ yarn add neutrino-middleware-minify


npm install --save neutrino-middleware-minify


neutrino-middleware-minify can be consumed from the Neutrino API, middleware, or presets. Require this package and plug it into Neutrino:

// Using function middleware format
const minify = require('neutrino-middleware-minify');

// Use with default options

// Usage showing overriding minification options
neutrino.use(minify, {
  babili: {},
  overrides: {}
// Using object or array middleware format

// Use with default options
module.exports = {
  use: ['neutrino-middleware-minify']

// Usage showing overriding minification options
module.exports = {
  use: [
    ['neutrino-middleware-minify', {
      babili: {},
      overrides: {}

The babili and overrides properties map to the options defined by babili-webpack-plugin.


neutrino-middleware-minify creates some conventions to make overriding the configuration easier once you are ready to make changes.


The following is a list of plugins and their identifiers which can be overridden:

Name Description Environments
minify Minifies source code using BabiliWebpackPlugin. all


This middleware is part of the neutrino-dev repository, a monorepo containing all resources for developing Neutrino and its core presets and middleware. Follow the contributing guide for details.

results matching ""

    No results matching ""