neutrino-patch

1.0.3 • Public • Published

Neutrino Patch

Adds simple methods to Neutrino to make managing configuration easier.

Install dependency

npm install --save neutrino-patch

Usage

const applyNeutrinoPatches = require('neutrino-patch');

const myMiddleware = () => (neutrino) => {
  applyNeutrinoPatches(neutrino);

  // adds extensions 'abc' and 'xyz' at end of list (lowest priority)
  neutrino.addSupportedExtensions('abc', 'xyz');

  // adds extensions 'yay' and 'woo' immediately before 'js' (higher priority)
  // (or at end of list if 'js' is not found)
  neutrino.addSupportedExtensionsBefore('js', 'yay', 'woo');

  // add a preset to the babel compile stage
  // (whether it has already been defined or not)
  neutrino.tapAtEnd('compile', 'babel', (options) => {
    options.presets.push(['@babel/some-preset-here', {}]);
    return options;
  });
};

Readme

Keywords

Package Sidebar

Install

npm i neutrino-patch

Weekly Downloads

31

Version

1.0.3

License

MIT

Unpacked Size

4.46 kB

Total Files

4

Last publish

Collaborators

  • davidje13