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

Webpack wrappers - string ids and namespaces #119

Merged
merged 1 commit into from Jun 9, 2020

Conversation

guybedford
Copy link
Contributor

This extends the support for webpack wrapper parsing to handle string ids in the Webpack module registry, as well as webpack ES module namespace object handling in determining full analysis of properties of those namespaces to the external when it is an external reference.

Webpack uses a __webpack_require__.n(obj) pattern here which is specifically detected and inlined in a way that can be used by the pure static analysis in further processing steps.

Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

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

Thanks!

@styfle styfle added the automerge Automatically merge PR once checks pass label Jun 9, 2020
@kodiakhq kodiakhq bot merged commit c7f25ef into master Jun 9, 2020
@kodiakhq kodiakhq bot deleted the webpack-wrappers-adv branch June 9, 2020 18:51
else if (parent.arguments && parent.arguments.some(arg => arg === node))
}
else if (parent.arguments && parent.arguments.some(arg => arg === node)) {
delete parent.scope.declarations[node.id];
Copy link
Member

Choose a reason for hiding this comment

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

@guybedford This is breaking Next.js tests because parent.scope.declarations is undefined.

Why is the delete necessary? Can it be guarded with if (parent.scope.declarations)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge PR once checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants