Skip to content

Commit

Permalink
Allow workspaces to run project npm tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Mar 14, 2023
1 parent 49b1279 commit 9c55eed
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tasks/npm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,20 @@ export async function script (name, args = []) {
const command = process.platform === 'win32' ? 'npm.cmd' : 'npm'

return new Promise((resolve, reject) => {
const script = spawn(command, ['run', name, '--silent', ...args])
const script = spawn(command, [
'run',
name,

// Allow workspaces to run project npm tasks
'--if-present',
'--include-workspace-root',

// Prevent duplicate npm output
// already logged by Gulp
'--silent',

...args
])

// Send output to console
script.stdout.on('data', (data) => console.log(data.toString()))
Expand Down

0 comments on commit 9c55eed

Please sign in to comment.