Hotloading imported css styles
See original GitHub issueAt the moment it seems that the post-css loader combined with ReactHotLoader and the postcss-import plugin does not auto-reload any stylesheets that get imported in a main css file.
I’ve created an example case in the following repo: https://github.com/0nn0/hotloader-postcss-imports/tree/postcss-import-plugin
You can produce the problem using the following steps.
- Check out Branch
postcss-import-plugin
- Run npm install
- Run npm run start
- Open http://localhost:3000/
- Change background-color in styles.css (change will be directly visible)
- Change background-color in component.css (change will NOT be visible until you restart the app)
Is there a way that this can be solved?
@MoOx offered a suggestion here that the postcss-loader perhaps can make use of onImport like here if postcss-import is detected?
Issue Analytics
- State:
- Created 8 years ago
- Comments:36 (17 by maintainers)
Top Results From Across the Web
Webpack 3 + PostCSS does not hotloading when changed ...
And I'm using Webpack 3, the hotloading feature doesn't work if I touch a css file that is an @import, people suggesed me...
Read more >import - CSS: Cascading Style Sheets - MDN Web Docs
The @import CSS at-rule is used to import style rules from other valid stylesheets. An @import rule must be defined at the top...
Read more >Css changes are lost whenever I hot reload(using parcel) my ...
Problem: Whenever I'm making changes in my sass file and hot reloading that sass file using parcel. Instantly, I can see the changes...
Read more >Adam Wathan on Twitter: "@jeffscottward @tailwindcss ...
Getting the css injected anywhere to even start using it. Yes I did. It would seem straightforward but didn't work. And which way...
Read more >Difference between Hot Reloading and Live ... - GeeksforGeeks
Hot reloading and Live reloading are something that Reacts Native ... import { Button, StyleSheet, View, Text } from "react-native" ;.
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 Free
Top 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
For those new to Webpack and coming to this thread and going “wah?!?” the exact code is:
Hopefully precss will support this soon, so we won’t need to use the postcss-import plugin as well.
Use
postcss-import@8.1.0
. (https://github.com/postcss/postcss-import/issues/207)