Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Tooling: Pass individual files as arguments from watch to build script #15219

Merged
merged 1 commit into from
Apr 29, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/packages/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
const fs = require( 'fs' );
const watch = require( 'node-watch' );
const { execSync } = require( 'child_process' );
const { spawn } = require( 'child_process' );
const path = require( 'path' );
const chalk = require( 'chalk' );

Expand All @@ -12,7 +12,7 @@ const chalk = require( 'chalk' );
*/
const getPackages = require( './get-packages' );

const BUILD_CMD = `node \"${ path.resolve( __dirname, './build.js' ) }\"`;
const BUILD_SCRIPT = path.resolve( __dirname, './build.js' );

let filesToBuild = new Map();

Expand Down Expand Up @@ -69,7 +69,7 @@ setInterval( () => {
if ( files.length ) {
filesToBuild = new Map();
try {
execSync( `${ BUILD_CMD } \"${ files.join( ' ' ) }\"`, { stdio: [ 0, 1, 2 ] } );
spawn( 'node', [ BUILD_SCRIPT, ...files ], { stdio: [ 0, 1, 2 ] } );
} catch ( e ) {}
}
}, 100 );
Expand Down