preact build ignores CSS files
See original GitHub issueDo you want to request a feature or report a bug? Bug
What is the current behaviour?
When importing a CSS file, preact build
ignores it while preact watch
puts it in the build.
If the current behaviour is a bug, please provide the steps to reproduce. Import a CSS file without specifying imports.
import "@material/radio/dist/mdc.radio.css";
And run build
. The CSS file will not be in the build folder and the page will miss this styles.
What is the expected behaviour? Preact bundles the styles in the CSS file, without changing the class names.
If this is a feature request, what is motivation or use case for changing the behaviour?
Please mention other relevant information.
Please paste the results of preact info
here.
Unknown argument: info
Version is 2.2.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (1 by maintainers)
Top Results From Across the Web
Importing CSS as React/Preact components with webpack ...
I'm building an app that is supposed to be embedded on 3rd party websites and for such kind of applications the build size...
Read more >How can I set a CSS name not to be a hash in a Webpack ...
1: At the app level, you can add the following configuration to your Webpack to disable CSS modules. · 2: At the file...
Read more >Advanced Features: Next.js Compiler
The Next.js Compiler, written in Rust using SWC, allows Next.js to transform and minify your JavaScript code for production. This replaces Babel for...
Read more >Common Error Details - Snowpack
The fix for .css files is similar to JS. Prefix a ./ to the import path like so: - @import ...
Read more >ESM>CDN
Create modern(es2015+) web apps easily with NPM packages in browser/deno. ... This only works when the NPM package imports CSS files in JS...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The issue might happen if you include the css files in
src/components
orsrc/routes
, because files imported from there get treated as css modules@DerDrodt sorry, my bad. I didn’t quite understand the problem.
I have 2 possible workarounds for you:
src/index.js
don’t have hashed class names. So moving yourimport "@material/radio/dist/mdc.radio.css";
tosrc/index.js
might solve your issue..scss
file: