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

Commit

Permalink
feat(run-build-update): handle linked npm modules (#375)
Browse files Browse the repository at this point in the history
  • Loading branch information
alan-agius4 authored and danbucholtz committed Nov 15, 2016
1 parent cfc32ca commit 0f113c8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,14 @@ export function runBuildUpdate(context: BuildContext, changedFiles: ChangedFile[
changedFiles: changedFiles.map(f => f.filePath)
};

const jsFiles = changedFiles.filter(f => f.ext === '.js');
if (jsFiles.length) {
// this is mainly for linked modules
// if a linked library has changed (which would have a js extention)
// we should do a full transpile build because of this
context.bundleState = BuildState.RequiresUpdate;
}

const tsFiles = changedFiles.filter(f => f.ext === '.ts');
if (tsFiles.length > 1) {
// multiple .ts file changes
Expand Down Expand Up @@ -274,7 +282,7 @@ export function runBuildUpdate(context: BuildContext, changedFiles: ChangedFile[
}

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

return data;
}
Expand Down

0 comments on commit 0f113c8

Please sign in to comment.