зеркало из https://github.com/microsoft/just.git
moved typescript task function into a function factory
This commit is contained in:
Родитель
2aa3d2b219
Коммит
02367ccf6c
|
@ -18,12 +18,16 @@ export function tscTask(options: ts.CompilerOptions) {
|
||||||
[tscCmd]
|
[tscCmd]
|
||||||
);
|
);
|
||||||
|
|
||||||
const cp = spawn(process.execPath, args, { stdio: 'inherit' });
|
const cp = spawn(process.execPath, args, { stdio: 'pipe' });
|
||||||
|
|
||||||
cp.stdout.on('data', data => {
|
cp.stdout.on('data', data => {
|
||||||
this.logger.info(data.toString().trim());
|
this.logger.info(data.toString().trim());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
cp.stderr.on('error', data => {
|
||||||
|
this.logger.error(data.toString().trim());
|
||||||
|
});
|
||||||
|
|
||||||
cp.on('exit', code => {
|
cp.on('exit', code => {
|
||||||
if (code !== 0) {
|
if (code !== 0) {
|
||||||
return done(new Error('Error in typescript'));
|
return done(new Error('Error in typescript'));
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const { spawn } = require('child_process');
|
const { spawn } = require('child_process');
|
||||||
|
|
||||||
['', 'typescript', 'webpack'].forEach(pkg => {
|
['', 'typescript', 'webpack'].forEach(pkg => {
|
||||||
const name = ['build', 'rig', ...(pkg ? [pkg] : [])];
|
const name = ['just', 'task', ...(pkg ? [pkg] : [])];
|
||||||
|
|
||||||
const cp = spawn('tsc', ['-p', `packages/${name.join('-')}`, '-w', '--preserveWatchOutput'], { stdio: 'pipe' });
|
const cp = spawn('tsc', ['-p', `packages/${name.join('-')}`, '-w', '--preserveWatchOutput'], { stdio: 'pipe' });
|
||||||
cp.stdout.pipe(process.stdout);
|
cp.stdout.pipe(process.stdout);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче