Skip to content
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

Live reload doesn't work on @import scss files from other scss files #71

Closed
silentiumsi opened this issue Dec 12, 2018 · 3 comments
Closed

Comments

@silentiumsi
Copy link

silentiumsi commented Dec 12, 2018

Description

When using a main scss file to @import other scss files, live reload only works when saving the parent file.

Steps to reproduce

  1. Create "main.scss"
  2. Create "_other.scss"
  3. @import "_other.scss" in "main.scss"
  4. Run "gridsome develop"
  5. Change code in "_other.scss"
  6. Live reload doesn't notice the change and trigger

Expected result

Live reload should be triggered by changing and saving "_other.scss"

Actual result

Live reload isn't triggered unless parent scss file "main.scss" is saved

@Devportobello
Copy link
Contributor

Cannot reproduce this error on Gridsome v0.3.6

main.js

import '~/assets/styles.scss'

styles.scss

@import "_test.scss";
a {
  color: red;
}

_test.scss

a {
  text-decoration: underline;
}

gridsome develop then editing _test.scss i can see hot reloading

@silentiumsi
Copy link
Author

Deleting the node_modules directory and rerunning npm install seemed to fix the issue. I'll close the issue for now.

@NadiaRom
Copy link

NadiaRom commented Mar 6, 2019

Cannot reproduce this error on Gridsome v0.3.6

main.js

import '~/assets/styles.scss'

styles.scss

@import "_test.scss";
a {
  color: red;
}

_test.scss

a {
  text-decoration: underline;
}

gridsome develop then editing _test.scss i can see hot reloading

Thank you! Yes, this is how it worked.
Import in .vue files as '~assets/scss/style.scss',
and in style.scss @import './variables.scss' - located in the same '~assets/scss/' folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants