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

improve build deps tracking (ESM, non-JS, better warnings) #12419

Merged
merged 3 commits into from Jan 13, 2021

Conversation

sokra
Copy link
Member

@sokra sokra commented Jan 13, 2021

#12418
fixes #11908

What kind of change does this PR introduce?
feature

Did you add tests for your changes?
yes

Does this PR introduce a breaking change?
no

What needs to be documented once your changes are merged?
BuildDependencies can now track ESM modules in an experimental way.

@webpack-bot
Copy link
Contributor

For maintainers only:

  • This needs to be documented (issue in webpack/webpack.js.org will be filed when merged)
  • This needs to be backported to webpack 4 (issue will be created when merged)

@sokra sokra changed the title add test case for ESM tracking improve build deps tracking (ESM, non-JS, better warnings) Jan 13, 2021
@@ -1211,7 +1215,12 @@ class FileSystemInfo {
break;
}
case RBDT_FILE_DEPENDENCIES: {
// TODO this probably doesn't work correctly with ESM dependencies
// Check for known files without dependencies
if (/\.json5?$|\.yarn-integrity$|yarn\.lock$|\.ya?ml/.test(path)) {
Copy link
Member

Choose a reason for hiding this comment

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

What about markdown?

Copy link
Member Author

Choose a reason for hiding this comment

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

That's usually not imported in node.js so it doesn't matter that much, but I also thought about that and concluded that it's not totally safe to do since there are dialects like MDX that could have dependencies.

@sokra sokra merged commit 588dda3 into master Jan 13, 2021
@sokra sokra deleted the feature/esm-tracking branch January 13, 2021 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Caching failed for pack: Error: Unable to snapshot build dependencies
3 participants