Skip to content

Commit

Permalink
Update: add TypeScript definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
niedzielski authored and cdeutsch committed Apr 24, 2018
1 parent 50084ab commit c238bc3
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
41 changes: 41 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import * as webpack from 'webpack'

declare namespace WebpackShellPlugin {
interface Options {
/** Scripts to execute on the initial build. Defaults to []. */
onBuildStart?: string[]

/**
* Scripts to execute after files are emitted at the end of the
* compilation. Defaults to [].
*/
onBuildEnd?: string[]

/** Scripts to execute after Webpack's process completes. Defaults to []. */
onBuildExit?: string[]

/**
* Switch for development environments. This causes scripts to execute once.
* Useful for running HMR on webpack-dev-server or webpack watch mode.
* Defaults to true.
*/
dev?: boolean

/**
* Switches script execution process from spawn to exec. If running into
* problems with spawn, turn this setting on. Defaults to false.
*/
safe?: boolean

/** DEPRECATED. Enable for verbose output. Defaults to false. */
verbose?: boolean
}

class Plugin extends webpack.Plugin {
constructor(options?: Options)
}
}

declare module 'webpack-shell-plugin' {
export = WebpackShellPlugin.Plugin
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.5.0",
"description": "Run shell commands before and after webpack builds",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"scripts": {
"test": "webpack",
"test:dev": "webpack-dev-server --progress",
Expand Down

0 comments on commit c238bc3

Please sign in to comment.