How to use the raw-loader plugin with turbopack only for specific file imports ? #77831
Unanswered
ThomasCarca
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
Hello, trying to move from webpack to turbopack for a documentation website running Next.js through Nextra v4.
We are using raw-loading a lot to embed generated css files content to our documentation but also to add them to the context of our sandbox components based on sandpack.
We used to set the
!!raw-loader!
prefix to any file import we would need to get the raw content rather than the file itself, which also allowed us to import the file as is in other scenarios :Following the documentation, all I could find is setting additional rules in the next configuration so that files matching a certain pattern can be handled by a given loader :
While this is working fine, this prevents to ever use two different kind of loaders for a given file : either we are raw-loading it or not, which is unfortunately an issue for us.
I am looking for any kind of suggestion, or advise from people who went through a similar scenario during a migration.
Many thanks !
Additional information
No response
Example
No response
Beta Was this translation helpful? Give feedback.
All reactions