unjs / unbuild

📦 A unified JavaScript build system

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannot use stub with `file://` protocol and esno (WSL2)

MarvinXu opened this issue · comments

Environment

Win 11, WSL2
unbuild@2.0.0

Reproduction

  1. create project following usage in Ubuntu WSL2
  2. run npx unbuild --stub

Describe the bug

Output file dist/index.mjs have incorrect filepath of jiti ( file:// points to Windows file system while the following path is in Linux subsystem)

import jiti from "file:///home/marv/.npm/_npx/97e73b3cab55bb68/node_modules/jiti/lib/index.js";
...

Additional context

No response

Logs

No response

fixed?

No. I'm just having second thoughts on if it's a bug of this package😂. The output .mjs can be run correctly with command node index.mjs, it just can't be resolved in other projects.
image

it just can't be resolved in other projects.

Okay interesting. It seems esno does not likes import with file:// protocol. /cc @antfu just to be in context.

(opened to investigate if we can do anything to mitigate this)

BTW, vscode doesn't seem to resolve this path either. I'll have to remove file://
recording