File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 1
1
# webpack-hooks-shellscripts
2
2
3
3
[ ![ 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] )
4
6
5
7
> 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 )
You can’t perform that action at this time.
0 commit comments