Skip to content

Commit 63e16a8

Browse files
author
Michel Hofmann
committed
feat: option swallowError to not fail webpack on failed scripts
1 parent a65ae75 commit 63e16a8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ Once the build finishes, a child process is spawned firing both a python and nod
7979
* `dev`: switch for development environments. This causes scripts to execute once. Useful for running HMR on webpack-dev-server or webpack watch mode. **Default: true**
8080
* `safe`: switches script execution process from spawn to exec. If running into problems with spawn, turn this setting on. **Default: false**
8181
* `verbose`: **DEPRECATED** enable for verbose output. **Default: false**
82+
* `swallowError`: ignore script errors (useful in watch mode) **Default: false**
8283

8384
### Developing
8485

src/webpack-shell-plugin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ const defaultOptions = {
88
onBuildExit: [],
99
dev: true,
1010
verbose: false,
11-
safe: false
11+
safe: false,
12+
swallowError: false
1213
};
1314

1415
export default class WebpackShellPlugin {
@@ -17,7 +18,7 @@ export default class WebpackShellPlugin {
1718
}
1819

1920
puts(error, stdout, stderr) {
20-
if (error) {
21+
if (error && !swallowError) {
2122
throw error;
2223
}
2324
}

0 commit comments

Comments
 (0)