Skip to content

fix(changes_hunter): guard for incrementalRebuild while watching #823

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions packages/core/src/lib/changes_hunter.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,20 @@ ChangesHunter.prototype = {

const node = patternlab.graph.node(pattern);

// Make the pattern known to the PatternGraph and remember its compileState
if (!node) {
// IF we are rebuilding due to watching and incrementally building, force add patterns to graph
if (
patternlab.incrementalBuildsEnabled &&
Object.keys(patternlab.watchers).length
) {
patternlab.graph.add(pattern);
} else {
// Works via object reference, so we directly manipulate the node data here
node.compileState = pattern.compileState;
// Make the pattern known to the PatternGraph and remember its compileState
if (!node) {
patternlab.graph.add(pattern);
} else {
// Works via object reference, so we directly manipulate the node data here
node.compileState = pattern.compileState;
}
}
},

Expand Down