Skip to content

Commit d84d314

Browse files
authored
Merge branch 'master' into addon-test-support
2 parents d826b85 + dbadfb5 commit d84d314

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

lib/incremental-typescript-compiler/typescript-output-plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ module.exports = class TypescriptOutput extends Plugin {
3030
for (let relativeSrc of Object.keys(this.paths)) {
3131
let src = `${this.compiler.outDir()}/${relativeSrc}`;
3232
let dest = `${this.outputPath}/${this.paths[relativeSrc]}`;
33-
if (fs.existsSync(src)) {
33+
if (fs.existsSync(src) && !fs.existsSync(dest)) {
3434
let dir = path.dirname(dest);
3535
if (dir !== '.') {
3636
fs.mkdirsSync(dir);

lib/utilities/compile.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function diagnosticCallback(callback) {
6969
}
7070

7171
function buildWatchHooks(project, ts, callbacks) {
72-
let ignorePatterns = ['\\..*?', 'dist', 'tmp', 'node_modules'];
72+
let ignorePatterns = ['\\..*?', 'dist', 'tmp'];
7373

7474
return Object.assign({}, ts.sys, {
7575
watchFile: null,
@@ -80,7 +80,7 @@ function buildWatchHooks(project, ts, callbacks) {
8080
}
8181

8282
let dir = getCanonicalCapitalization(path.resolve(rawDir));
83-
let ignored = buildIgnoreRegex(dir, ignorePatterns);
83+
let ignored = buildIgnoreDefs(dir, ignorePatterns);
8484
let watcher = chokidar.watch(dir, { ignored, ignoreInitial: true });
8585
debug(`watching directory %s %o`, dir, { ignored });
8686

@@ -105,10 +105,13 @@ function buildWatchHooks(project, ts, callbacks) {
105105
});
106106
}
107107

108-
function buildIgnoreRegex(rootDir, patterns) {
108+
function buildIgnoreDefs(rootDir, patterns) {
109109
let base = escapeRegex(rootDir);
110110
let sep = `[/\\\\]`;
111-
return new RegExp(`^${base}${sep}(${patterns.join('|')})${sep}`, 'i');
111+
return [
112+
'**/node_modules/**',
113+
new RegExp(`^${base}${sep}(${patterns.join('|')})${sep}`, 'i')
114+
];
112115
}
113116

114117
// On case-insensitive file systems, tsc will normalize paths to be all lowercase,

0 commit comments

Comments
 (0)