Skip to content

Commit f9d84e9

Browse files
committed
Update: add TypeScript definitions
fix #51
1 parent a65ae75 commit f9d84e9

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

lib/index.d.ts

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import * as webpack from 'webpack'
2+
3+
declare namespace WebpackShellPlugin {
4+
interface Options {
5+
/** Scripts to execute on the initial build. Defaults to []. */
6+
onBuildStart?: string[]
7+
8+
/**
9+
* Scripts to execute after files are emitted at the end of the
10+
* compilation. Defaults to [].
11+
*/
12+
onBuildEnd?: string[]
13+
14+
/** Scripts to execute after Webpack's process completes. Defaults to []. */
15+
onBuildExit?: string[]
16+
17+
/**
18+
* Switch for development environments. This causes scripts to execute once.
19+
* Useful for running HMR on webpack-dev-server or webpack watch mode.
20+
* Defaults to true.
21+
*/
22+
dev?: boolean
23+
24+
/**
25+
* Switches script execution process from spawn to exec. If running into
26+
* problems with spawn, turn this setting on. Defaults to false.
27+
*/
28+
safe?: boolean
29+
30+
/** DEPRECATED. Enable for verbose output. Defaults to false. */
31+
verbose?: boolean
32+
}
33+
34+
class Plugin extends webpack.Plugin {
35+
constructor(options?: Options)
36+
}
37+
}
38+
39+
declare module 'webpack-shell-plugin' {
40+
export = WebpackShellPlugin.Plugin
41+
}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.5.0",
44
"description": "Run shell commands before and after webpack builds",
55
"main": "lib/index.js",
6+
"types": "lib/index.d.ts",
67
"scripts": {
78
"test": "webpack",
89
"test:dev": "webpack-dev-server --progress",

0 commit comments

Comments
 (0)