nitro
nitro copied to clipboard
support `?raw` imports like vite does
Describe the feature
context: https://github.com/nuxt/nuxt/issues/21487
currently if a have universal-logic.ts that looks like this:
import file1 from './hello.txt?raw`
... other logic
Nitro (and thus Nuxt server) is not able to find the file. It would be great to have the ability to have truly universal imports across the server and the client and to allow even more code reuse
Additional information
- [ ] Would you be willing to help implement this feature?
We already have a raw loader. For sake for Vite consistency, ?raw seems a good alternative (also there were legacy reasons we were not resolving relative paths, now we don't have those)
~> https://github.com/unjs/nitro/issues/2390