-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to import css file to js with preserveModules option enabled? #247
Comments
I have the same question about the SCSS format.
Expected transpile files structure
And in
rather than |
I drafted a plugin to explain my idea, here is the codesandbox. The file name is The content is plain CSS rather than JS. Here is the main code
I'm not familiar with Rollup's mechanism, but I believe there must be a better way to achieve this. Anyone who has an idea, please let me know. |
Hi everyone.
Im wondering is it possible to import css files into js using import syntax with preserveModules:true in rollup config?
Bundling all css in one file is not an option, because Im making ui library. Also injecting css to works bad on Nextjs.
Bellow file structure of what Im trying to achieve.
index.js
Source files structure
-src
--components
---button
----index.ts
----index.module.css
---link
----index.ts
----index.module.css
Expected transpiled files structure
-lib
--components
---button
----index.js
----index.css
---link
----index.js
----index.css
The text was updated successfully, but these errors were encountered: