Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 0f113c8

Browse files
alan-agius4danbucholtz
authored andcommitted
feat(run-build-update): handle linked npm modules (#375)
1 parent cfc32ca commit 0f113c8

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/watch.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,14 @@ export function runBuildUpdate(context: BuildContext, changedFiles: ChangedFile[
212212
changedFiles: changedFiles.map(f => f.filePath)
213213
};
214214

215+
const jsFiles = changedFiles.filter(f => f.ext === '.js');
216+
if (jsFiles.length) {
217+
// this is mainly for linked modules
218+
// if a linked library has changed (which would have a js extention)
219+
// we should do a full transpile build because of this
220+
context.bundleState = BuildState.RequiresUpdate;
221+
}
222+
215223
const tsFiles = changedFiles.filter(f => f.ext === '.ts');
216224
if (tsFiles.length > 1) {
217225
// multiple .ts file changes
@@ -274,7 +282,7 @@ export function runBuildUpdate(context: BuildContext, changedFiles: ChangedFile[
274282
}
275283

276284
// guess which file is probably the most important here
277-
data.filePath = tsFiles.concat(sassFiles, htmlFiles)[0].filePath;
285+
data.filePath = tsFiles.concat(sassFiles, htmlFiles, jsFiles)[0].filePath;
278286

279287
return data;
280288
}

0 commit comments

Comments
 (0)