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

hot reloading doesn't work on styles "text/sass" with @import #88

Open
bugleev opened this issue Sep 27, 2019 · 2 comments
Open

hot reloading doesn't work on styles "text/sass" with @import #88

bugleev opened this issue Sep 27, 2019 · 2 comments

Comments

@bugleev
Copy link

bugleev commented Sep 27, 2019

Started here: rollup-plugin-svelte.
The problem:
I have a component using svelte-preprocess-sass like this:

<style type="text/sass">
@import "./test.sass"
</style>

when contents of test.sass are changed in dev mode, styles are not updated in the browser.
Although when i'm not using @import:

<style type="text/sass">
.someClass
  color: red
</style>

everything works fine.
Any ideas how to resolve this?

here's rollup.config.js:

export default {
  input: "src/main.js",
  output: {
    sourcemap: true,
    format: "iife",
    name: "app",
    file: "public/bundle.js"
  },
  plugins: [
    svelte({     
      dev: !production,
      preprocess: {
        style: sass({
          indentedSyntax: true
        }),
      },    
      css: css => {
        css.write("public/bundle.css");
      }
    }),
    resolve(),
    commonjs(),   
    !production && livereload("public"),
    production && terser()
  ]
};
@paco3346
Copy link

This really depends on your tooling and how you're watching. From your description it sounds like your file watcher isn't noticing the change to test.sass.

I use chokidar with rollup because it offers a few extra bells and whistles and I'm able to successfully trigger changes in the browser when I edit an import()ed sass file.

@bugleev
Copy link
Author

bugleev commented Sep 29, 2019

Thanks for response.
I added

watch: {
    chokidar: true
  }

to rollup.config.js, and installed chokidar, but that doesn't seem to have any effect.
scripts are like this:

"autobuild": "rollup -c -w",
"dev": "run-p start:dev autobuild",

Can you share your approach please, which makes things work?

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

2 participants