fix(turbopack): give eager `import.meta.glob` values the ESM namespace (#96559)
Eager glob values were built with a plain CommonJS require, so the value
was a
module's `exports` object rather than its ESM namespace — for JSON (or
any
CommonJS) module that meant no CommonJS interop ran, so
`modules[path].default`
(the shape our own docs show) and `{ import: 'default' }` were
`undefined`. A
hand-written `import * as ns from './data.json'` did have `default`.
Eager values now use the same namespace-import primitive a static
`import * as ns from '…'` produces.
<!-- NEXT_JS_LLM -->
Co-authored-by:
vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by:
Tobias Koppers <1365881+sokra@users.noreply.github.com>
Showing
Please
register
or
sign in
to comment