UNPKG

2.3 kBMarkdownView Raw
1# Neutrino Clean Middleware
2[![NPM version][npm-image]][npm-url] [![NPM downloads][npm-downloads]][npm-url] [![Join Slack][slack-image]][slack-url]
3
4`neutrino-middleware-clean` is Neutrino middleware for removing directories before building.
5
6## Requirements
7
8- Node.js v6.10+
9- Yarn or npm client
10- Neutrino v6
11
12## Installation
13
14`neutrino-middleware-clean` can be installed via the Yarn or npm clients.
15
16#### Yarn
17
18```bash
19❯ yarn add neutrino-middleware-clean
20```
21
22#### npm
23
24```bash
25❯ npm install --save neutrino-middleware-clean
26```
27
28## Usage
29
30`neutrino-middleware-clean` can be consumed from the Neutrino API, middleware, or presets. Require this package
31and plug it into Neutrino:
32
33```js
34// Using function middleware format
35const clean = require('neutrino-middleware-clean');
36
37// Use with default options
38neutrino.use(clean);
39
40// Usage shows the default values of this middleware:
41neutrino.use(clean, {
42 paths: [],
43 root: neutrino.options.root
44});
45```
46
47```js
48// Using object or array middleware format
49
50// Use with default options
51module.exports = {
52 use: ['neutrino-middleware-clean']
53};
54
55// Usage shows the default values of this middleware:
56module.exports = {
57 use: [
58 ['neutrino-middleware-clean', {
59 paths: [],
60 root: neutrino.options.root
61 }]
62 ]
63};
64```
65
66## Customization
67
68`neutrino-middleware-clean` creates some conventions to make overriding the configuration easier once you are ready to
69make changes.
70
71### Plugins
72
73The following is a list of plugins and their identifiers which can be overridden:
74
75| Name | Description | Environments |
76| ---- | ----------- | ------------ |
77| `clean` | Removes directories before building. | all |
78
79## Contributing
80
81This middleware is part of the [neutrino-dev](https://github.com/mozilla-neutrino/neutrino-dev) repository, a monorepo
82containing all resources for developing Neutrino and its core presets and middleware. Follow the
83[contributing guide](https://neutrino.js.org/contributing) for details.
84
85[npm-image]: https://img.shields.io/npm/v/neutrino-middleware-clean.svg
86[npm-downloads]: https://img.shields.io/npm/dt/neutrino-middleware-clean.svg
87[npm-url]: https://npmjs.org/package/neutrino-middleware-clean
88[slack-image]: https://neutrino-slack.herokuapp.com/badge.svg
89[slack-url]: https://neutrino-slack.herokuapp.com/