Files
azuredatastudio/build/lib/watch/index.js
Karl Burtram dafb780987 Merge VS Code 1.21 source code (#1067)
* Initial VS Code 1.21 file copy with patches

* A few more merges

* Post npm install

* Fix batch of build breaks

* Fix more build breaks

* Fix more build errors

* Fix more build breaks

* Runtime fixes 1

* Get connection dialog working with some todos

* Fix a few packaging issues

* Copy several node_modules to package build to fix loader issues

* Fix breaks from master

* A few more fixes

* Make tests pass

* First pass of license header updates

* Second pass of license header updates

* Fix restore dialog issues

* Remove add additional themes menu items

* fix select box issues where the list doesn't show up

* formatting

* Fix editor dispose issue

* Copy over node modules to correct location on all platforms
2018-04-04 15:27:51 -07:00

40 lines
1.2 KiB
JavaScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
const es = require('event-stream');
/** Ugly hack for gulp-tsb */
function handleDeletions() {
return es.mapSync(f => {
if (/\.ts$/.test(f.relative) && !f.contents) {
f.contents = Buffer.from('');
f.stat = { mtime: new Date() };
}
return f;
});
}
let watch = void 0;
// Disabled due to https://github.com/Microsoft/vscode/issues/36214
// if (!process.env['VSCODE_USE_LEGACY_WATCH']) {
// try {
// watch = require('./watch-nsfw');
// } catch (err) {
// console.warn('Could not load our cross platform file watcher: ' + err.toString());
// console.warn('Falling back to our platform specific watcher...');
// }
// }
if (!watch) {
watch = process.platform === 'win32' ? require('./watch-win32') : require('gulp-watch');
}
module.exports = function () {
return watch.apply(null, arguments)
.pipe(handleDeletions());
};