Skip to content

Commit d3458ee

Browse files
committed
Provide documentation
1 parent ff314a4 commit d3458ee

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,53 @@
11
# webpack-hooks-shellscripts
22

33
[![Build Status](https://travis-ci.org/nutshell-lab/webpack-hooks-shellscripts.svg?branch=master)](https://travis-ci.org/nutshell-lab/webpack-hooks-shellscripts)
4+
[![Maintainability](https://api.codeclimate.com/v1/badges/3a0e1bb6be50fc9c0d47/maintainability)](https://codeclimate.com/github/nutshell-lab/webpack-hooks-shellscripts/maintainability)
5+
[![NPM bundle size](https://img.shields.io/bundlephobia/min/@nutshelllab/webpack-hooks-shellscripts.svg)](http://bundlephobia.com/result?p=@nutshelllab/[email protected])
46

57
> Just triggers some shellscripts on webpack compiler hooks.
8+
9+
## Install
10+
11+
```sh
12+
yarn add -D @nutshelllab/webpack-hooks-shellscripts
13+
```
14+
15+
## Usage
16+
17+
Add the plugin to your webpack config.
18+
19+
```js
20+
// webpack.config.js
21+
module.exports = {
22+
plugins: [
23+
hooksScriptPlugin({
24+
beforeEmit: ['rm -r ./dist'],
25+
afterEmit: ['echo "Build succeeded"']
26+
})
27+
]
28+
}
29+
```
30+
31+
## API
32+
33+
### hooksShellScriptsPlugin(bindings)
34+
35+
#### bindings
36+
37+
Type: `object`
38+
39+
Hooks/Scripts bindings.
40+
41+
```js
42+
// example
43+
{
44+
beforeRun: ['echo "do this"', 'echo "then that"'],
45+
beforeCompile: ['./do-something']
46+
}
47+
```
48+
49+
See https://webpack.js.org/api/compiler-hooks/ to get an exhaustive hooks list.
50+
51+
## License
52+
53+
MIT © [Nutshell](https://nutshell-lab.com)

0 commit comments

Comments
 (0)