Skip to content
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

count dynamic cross-chunk imports as dependencies #1135

Merged
merged 1 commit into from
Apr 11, 2021
Merged

Conversation

evanw
Copy link
Owner

@evanw evanw commented Apr 11, 2021

The hash included in the file name of each output file is intended to change if and only if anything relevant to the content of that output file changes. It includes:

  • The contents of the file with the paths of other output files omitted
  • The output path of the file the final hash omitted
  • Some information about the input files involved in that output file
  • The contents of the associated source map, if there is one
  • All of the information above for all transitive dependencies found by following import statements

However, this didn't include dynamic import() expressions due to an oversight. With this release, dynamic import() expressions are now also counted as transitive dependencies. This fixes an issue where the content of an output file could change without its hash also changing. As a side effect of this change, dynamic imports inside output files of other output files are now listed in the metadata file if the metafile setting is enabled.

Fixes #1076

@evanw evanw merged commit 0f008d9 into master Apr 11, 2021
@evanw evanw deleted the issues/1076 branch April 11, 2021 00:22
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.

esbuild sometimes produces chunks with same hashes but different contents
1 participant