Skip to content

Commit

Permalink
Ensure that child build processes started when running on Windows exi…
Browse files Browse the repository at this point in the history
…t properly.

plugin-run-script and plugin-build script use execa.command with the shell: true
option set to execute the user's command.  On Windows, this causes the child process
to remain running after Snowpack exits: sindresorhus/execa#433.
The fix is to override the default windowsHide option -- as Snowpack always runs from
a console we don't actually need execa to hide any extra console windows for us.
  • Loading branch information
pkaminski committed Sep 10, 2020
1 parent e5dfccc commit 4ba39f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugins/plugin-build-script/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ function buildScriptPlugin(_, {input, output, cmd}) {
env: npmRunPath.env(),
extendEnv: true,
shell: true,
windowsHide: false,
input: contents,
cwd,
});
Expand Down
1 change: 1 addition & 0 deletions plugins/plugin-run-script/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function runScriptPlugin(_, {cmd, watch, output}) {
env: npmRunPath.env(),
extendEnv: true,
shell: true,
windowsHide: false,
cwd,
});
const {stdout, stderr} = workerPromise;
Expand Down

0 comments on commit 4ba39f6

Please sign in to comment.