-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Preprocessor dependencies are not tracked #849
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
Comments
This is relying on svelte-preprocess "external files" feature: https://github.com/sveltejs/svelte-preprocess#external-files And likely does not work as intended because 2 things need to happen for it to work
There are 2 ways you can try to work around this right now:
<script>
import '../app.scss';
</script> This means that the style won't be scoped to index.svelte, which is likely what you want anyways
<style lang="scss">
@import "../app.scss"
</style> That should produce scoped style and vite should track the import, no clue about svelte-preprocess handling this correctly though. And as always with scss General rule of thumb for working with styles:
cc @kaisermann |
Thanks @dominikg for the explanation, but the second workaround that you told me: <style lang="scss">
@import "../app.scss"
</style> is not working. It has the same problem of not reloading. |
For If you're able to reproduce the issue in a simple svelte project (not kit + vite), please feel free to open an issue on the |
This is not a bug with svelte-preprocess, but one with svelte-kit, so I do not think that working with rollup with this would be a problem. I do not know if this is a problem with svelte-kit or vite. |
I was able to reproduce this in a vite-plugin-svelte playground and the plugin does not register the dependencies of preprocess output with vite correctly. see sveltejs/vite-plugin-svelte#25 |
Think we should close this to keep tracking there only? |
Yeah, thanks everyone. |
Describe the bug
Suppose I have installed svelte-preprocess and sass. Here is my index.svelte file:
So when I run
svelte-kit dev
the dev server is launched. If I make changes to the index.svelte file, the server is reloaded but if I make changes to app.scss file, the server is not reloaded and no change occurs.Expected behavior
When I make changes to app.scss file, the output should be updated.
Information about your SvelteKit Installation:
Diagnostics
OS: Windows 10 10.0.19041
CPU: (4) x64 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Memory: 2.70 GB / 7.80 GB
Node: 14.16.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
npm: 7.6.3 - C:\Program Files\nodejs\npm.CMD
Chrome: 81.0.4044.138
Edge: Spartan (44.19041.423.0), Chromium (89.0.774.68)
Internet Explorer: 11.0.19041.1
@sveltejs/kit: next => 1.0.0-next.70
svelte: ^3.37.0 => 3.37.0
vite: ^2.1.5 => 2.1.5
Severity
A serious bug for me as I cannot debug by scss styles.
Additional context
If a repro is needed I can provide one.
The text was updated successfully, but these errors were encountered: