Skip to content

Commit bb02180

Browse files
committed
Delay gulp-watch read so watch task isn't broken on slower disks.
vscode writes files non-atomically. This is useful on an azure devbox over ssh.
1 parent 0a378fd commit bb02180

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

build/gulpfile.extensions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const tasks = compilations.map(function (tsconfigFile) {
119119
const watchTask = task.define(`watch-extension:${name}`, task.series(cleanTask, () => {
120120
const pipeline = createPipeline(false);
121121
const input = pipeline.tsProjectSrc();
122-
const watchInput = watcher(src, srcOpts);
122+
const watchInput = watcher(src, { ...srcOpts, ...{ readDelay: 200 } });
123123

124124
return watchInput
125125
.pipe(util.incremental(pipeline, input))

build/lib/compilation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function watchTask(out, build) {
8181
return function () {
8282
const compile = createCompile('src', build);
8383
const src = gulp.src('src/**', { base: 'src' });
84-
const watchSrc = watch('src/**', { base: 'src' });
84+
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });
8585
let generator = new MonacoGenerator(true);
8686
generator.execute();
8787
return watchSrc

build/lib/compilation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export function watchTask(out: string, build: boolean): () => NodeJS.ReadWriteSt
9999
const compile = createCompile('src', build);
100100

101101
const src = gulp.src('src/**', { base: 'src' });
102-
const watchSrc = watch('src/**', { base: 'src' });
102+
const watchSrc = watch('src/**', { base: 'src', readDelay: 200 });
103103

104104
let generator = new MonacoGenerator(true);
105105
generator.execute();

0 commit comments

Comments
 (0)