next.js
1f04d8ff - [turbopack] Track usage of modules imported with `require()` (#95717)

Commit
117 days ago
[turbopack] Track usage of modules imported with `require()` (#95717) This PR introduces a new method `analyze_require_usage` that analyzes how something imported with `require()` is used. It has two passes: one catches simple things like `const { a } = require(...)` and `require(...).foo`, the next one then handles if you import using `const x = require(...)`. This then gets populated into `export_usage_info`, this will expand the set of exports we can drop through https://github.com/vercel/next.js/pull/95716.
Author
Parents
Loading