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 2 months ago
JSON representation
Adds simple methods to Neutrino to make managing configuration easier.
- Host: GitHub
- URL: https://github.com/davidje13/neutrino-patch
- Owner: davidje13
- License: mit
- Created: 2019-07-06T10:59:03.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-08-29T21:56:19.000Z (almost 6 years ago)
- Last Synced: 2025-03-08T14:02:52.281Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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;
});
};
```