Skip to content

Fix external renormalization regression (#2153) - #2160

Merged
lukastaegert merged 2 commits into
masterfrom
external-renormalize
Apr 30, 2018
Merged

Fix external renormalization regression (#2153)#2160
lukastaegert merged 2 commits into
masterfrom
external-renormalize

Conversation

@guybedford

@guybedford guybedford commented Apr 26, 2018

Copy link
Copy Markdown
Contributor

In the shift to code-splitting, there was a regression in f59e310#diff-a1d1f47eb8dcd4b0026545f1e89b1b95.

The issue here has been making the conceptual model of single file builds adapt to the output model of a file structure in code splitting builds, while handling external naming in a way that can be reliably hashed as well as renormalized into the output folder.

In short the fix is to:

  1. Adapt the inputBase we're already using for preserveModules to be an input into the preRender function
  2. Marking which external modules should be "renormalized" (those that aren't absolute or set by options.paths)
  3. Normalizing the external module id relative to the inputBase into a "virtual file space" for code splitting
  4. Renormalizing the external module id on chunk write to be relative to the chunk itself, now that we know where it sits int he virtual file space of the build.

@lukastaegert lukastaegert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@lukastaegert
lukastaegert force-pushed the external-renormalize branch from c0844d6 to 2efabba Compare April 30, 2018 19:54
@lukastaegert lukastaegert added this to the 0.59.0 milestone Apr 30, 2018
@lukastaegert
lukastaegert merged commit 2efabba into master Apr 30, 2018
@lukastaegert
lukastaegert deleted the external-renormalize branch April 30, 2018 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants