mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
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.
7 lines
131 B
JSON
7 lines
131 B
JSON
{
|
|
"removeUnusedImports": false,
|
|
"removeUnusedExports": true,
|
|
"cjsTreeShaking": true,
|
|
"treeShakingMode": "reexports-only"
|
|
}
|