You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tries to locate external modules on the filesystem at build time, and if they're not found it introduces empty virtual modules for them.
But this means we cannot actually use externals the way that both webpack and rollup typically understand externals: they're supposed to get resolved at runtime. Whether they existed during build time is not supposed to matter.
Expected behavior:
If my resolveId hook returns false, the original import statement should be left alone in the output, so that it will be resolved at runtime.
If my resolveId hook returns { external: true, id: 'xyz' }, the original import statement gets replaced with an import statement for 'xyz', and that redirected import statement will get resolved at runtime.
Actual behavior:
In both the above cases, the original import is replaced with an empty virtual module, and no runtime resolution ever happens.
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered:
Environment
unplugin 1.0.1
Reproduction
https://github.com/ef4/unplugin-bug-repro (edited to add)
Describe the bug
This code:
unplugin/src/webpack/index.ts
Lines 126 to 128 in c29ef3e
tries to locate external modules on the filesystem at build time, and if they're not found it introduces empty virtual modules for them.
But this means we cannot actually use
externals
the way that both webpack and rollup typically understandexternals
: they're supposed to get resolved at runtime. Whether they existed during build time is not supposed to matter.Expected behavior:
resolveId
hook returnsfalse
, the original import statement should be left alone in the output, so that it will be resolved at runtime.resolveId
hook returns{ external: true, id: 'xyz' }
, the original import statement gets replaced with an import statement for'xyz'
, and that redirected import statement will get resolved at runtime.Actual behavior:
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: