You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When: 1) a dependency graph is such that generated chunks have dependencies on one another; and 2) the chunkNames option introduces additional directory segments, inter-chunk dependencies will have incorrect paths.
Given a chunkNames configuration of chunks/[name]-[hash], an inter-dependency chunk will look like ./chunks/chunk-4VGHEGUY.js instead of ./chunk-4VGHEGUY.js.
I've prepared as minimal of a reproduction as I could in this repl.it.
The text was updated successfully, but these errors were encountered:
Thanks for the detailed reproduction. This is what I get for trying to cherry-pick a feature from my rewrite branch back to master :)
It should be straightforward to fix, so I'll fix it in the next release. The problem is that import paths are currently embedded in the file before the final hash is calculated so cross-chunk relative imports were not taking the subdirectory into account (since the final path depended on the final hash, which didn't exist yet). I think a sufficient fix should be to provide a fake final path for chunks that haven't computed the final hash yet, just for the purpose of computing the relative path.
This issue is sort of the reason why entry point hashes aren't supported yet. The current code splitting algorithm never generates chunks with import cycles so you can always be sure that the hashes for a chunk's imports will be computed before that chunk's hash needs to be computed. But that doesn't work for entry points because dynamic entry points can import each other. I plan to fix this by embedding import paths in the file after the final hash is calculated instead. The algorithm that I will be using for this in the future is described here: #518 (comment).
When: 1) a dependency graph is such that generated chunks have dependencies on one another; and 2) the
chunkNames
option introduces additional directory segments, inter-chunk dependencies will have incorrect paths.Given a
chunkNames
configuration ofchunks/[name]-[hash]
, an inter-dependency chunk will look like./chunks/chunk-4VGHEGUY.js
instead of./chunk-4VGHEGUY.js
.I've prepared as minimal of a reproduction as I could in this repl.it.
The text was updated successfully, but these errors were encountered: