unjs / unplugin

Unified plugin system for Vite, Rollup, Webpack, esbuild, Rolldown, and more
https://unplugin.unjs.io
MIT License
3.02k stars 109 forks source link

Webpack behavior incorrectly assumes the starting directory for resolving files is the users current working directory #375

Open NullVoxPopuli opened 6 months ago

NullVoxPopuli commented 6 months ago

Environment

I already put up a PR with info here: https://github.com/unjs/unplugin/pull/374

unplugin: ^1.10.0 node: 18.19.0

Reproduction

https://github.com/NullVoxPopuli/embroider-3--unplugin-plugin-loads-app-files

initial report (with a lot more details): https://github.com/embroider-build/embroider/issues/1843 (embroider for all intents and purposes of this bug report is a webpack plugin)

Describe the bug

the webpack plugin assumes that the resolving should happen from the user's CWD -- but an alternate CWD may be used in some environments, causing resolution of files to fail.

Additional context

No response

Logs

See: https://github.com/embroider-build/embroider/issues/1843