Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/davidje13/neutrino-patch

Adds simple methods to Neutrino to make managing configuration easier.
https://github.com/davidje13/neutrino-patch

Last synced: about 1 month ago
JSON representation

Adds simple methods to Neutrino to make managing configuration easier.

Awesome Lists containing this project

README

        

# Neutrino Patch

Adds simple methods to Neutrino to make managing configuration easier.

## Install dependency

```bash
npm install --save neutrino-patch
```

## Usage

```javascript
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;
});
};
```