Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/davidje13/neutrino-patch
- Owner: davidje13
- License: mit
- Created: 2019-07-06T10:59:03.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-29T21:56:19.000Z (over 4 years ago)
- Last Synced: 2024-11-18T09:12:30.321Z (about 2 months 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;
});
};
```