alias
is handled before attemptnig to find the module, breaking any usages with @
alias
#450
Labels
bug
Something isn't working
Environment
unbuild:
v3.0.0-rc.11
Node.js:
v20.18.1
Reproduction
https://github.com/xsjcTony/unocss-preset-animations
If
unbuild
's version is upgraded tov3.0.0-rc.2
or greater, externals won't work as expected due to this issue.Describe the bug
Because of the implementation here https://github.com/unjs/unbuild/blob/main/src/builders/rollup/utils.ts#L44-L54 simply replace all alias keys, normal usages like
@
will break.E.g. when I'm trying to alias my root as
@
, then I'll have something likeBut I can also have something like
This will break straight away with setting
Resulting in something like
Hence even if I set
@unocss/core
inexternals
, it will still be inlined.Solution:
I think it should attempt to find the module first, before parsing alias, giving it a chance to find the correct package straight away.
Additional context
😂Every package start with
@
just breaks@jridgewell/sourcemap-codec
->
C:\Dev\personal-projects\unocss-preset-animations\srcjridgewell/sourcemap-codec
Logs
No response
The text was updated successfully, but these errors were encountered: