lvarayut / relay-fullstack

:point_up::running: Modern Relay Starter Kit - Integrated with Relay, GraphQL, Express, ES6/ES7, JSX, Webpack, Babel, Material Design Lite, and PostCSS
https://lvarayut.github.io/relay-fullstack/
MIT License
985 stars 126 forks source link

HMR not working for variables.scss #80

Closed BlakeBrown closed 7 years ago

BlakeBrown commented 7 years ago

Quick question! Disclaimer: Noob to webpack & HMR

If I change colours in say App.scss:

.greeting {
  background-color: $blue;
}

to

.greeting {
  background-color: $black;
}

the app will reload no problem. However if I make changes in variables.scss, say: $white: #FFFFFF; to $white: #EEE;

... then the app will fail to reload. Is there any explanation for this?

lvarayut commented 7 years ago

Hey @BlakeBrown, thanks for your question. It's because the variables.scss has never been imported and used in any component. On the other hand, App.scss has been imported and used in AppComponent.js. That's why HMR can detect any changes from App.scss

BlakeBrown commented 7 years ago

@lvarayut thanks so much for getting back to me! I guess it's a little bit of a "gotcha" that nested imports don't cause reloads, but I guess you can always restart the server if you need to.

Loving this starter kit so far, thanks a lot! :)

lvarayut commented 7 years ago

You're very welcome :), glad that you love Relay Fullstack.I'm going to close this issue for now. Please feel free to continue the discussion here if you had more question!