Skip to content

Commit

Permalink
fix(dev): don't detach process on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Akryum committed Mar 1, 2020
1 parent 03f38dc commit 5a6daaa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/@nodepack/service/src/commands/dev.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const commonCommandOptions = require('../util/commonCommandOptions')
const os = require('os')

/** @type {import('../../types/ServicePlugin').ServicePlugin} */
module.exports = (api, options) => {
Expand Down Expand Up @@ -95,14 +96,14 @@ module.exports = (api, options) => {
const file = api.resolve(path.join(webpackConfig.output.path, 'app.js'))

// Spawn child process
const currentChild = child = execa('node', [
const currentChild = child = execa(process.argv0, [
...(args.dbg ? [`--inspect-brk=${args.dbg}`] : []),
file,
], {
stdio: [process.stdin, process.stdout, process.stderr],
cwd: api.getCwd(),
env: moreEnv,
detached: true,
detached: os.platform() !== 'win32',
})

child.on('error', err => {
Expand Down

0 comments on commit 5a6daaa

Please sign in to comment.