Repository navigation
make/webpack: dev builds resolve the lock with the node modules, so the bundle that depends on it has a rule that makes it - #60
Merged
Conversation
…he bundle that depends on it has a rule that makes it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In dev mode, the rule that runs
npm inow also declares the stagedpackage-lock.jsonas one of its outputs, so the bundle's dependency on the lock has a rule that makes it.The regression
#59 (04b724e) made the staged
package-lock.jsona prerequisite of the webpack bundle, so that a change to the resolved dependencies rebuilds it. The release modes install throughwebpack.npm.install.locked, which has a rule that copies the committed lock into the staging area. Dev mode installs throughwebpack.npm.install.fresh, where the lock is written bynpm ias a side effect and no rule names it. A staging area that already held a lock from an earlier install treated it as a source file, so the gap stayed hidden. In a fresh build context the lock does not exist yet, and every dev build of a webpack bundle stops with:The change
webpack.npm.install.freshis now a grouped target, so a singlenpm imakes both the node modules and the lock:The recipe touches both outputs, as it already did for the modules, because
npm ileaves them alone when there is nothing to install. Whennpm iresolves the dependency tree again, the bundle is rebuilt. The locked install is unchanged.Verification
In qed, in dev mode, from a fresh build context: the full build succeeds, and a second
mmright after runs neithernpm inor webpack.