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

Changes from @import-ed CSS files are not applied #231

Open
kucrut opened this issue Jan 4, 2022 · 1 comment
Open

Changes from @import-ed CSS files are not applied #231

kucrut opened this issue Jan 4, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@kucrut
Copy link

kucrut commented Jan 4, 2022

Even after reloading the browser, changes from CSS files that are @import-ed from <style> tags are not applied, until the svelte file is saved. I can confirm that the issue is happening on MacOS & (Arch) Linux.

Below is a video demonstrating it on vanilla Elder template.

elder-css-changes-not-applied.mp4
@eight04 eight04 added the bug Something isn't working label Nov 4, 2022
@eight04
Copy link
Contributor

eight04 commented Nov 5, 2022

I think the @import statement is processed by clean-css:

const cleanCss = new CleanCSS({
sourceMap: true,
sourceMapInlineSources: true,
level: isDev ? 0 : 1,
rebaseTo: elderConfig.distDir,
// rebase: elderConfig.distDir,
});
const sorted = sortCss(css);
return {
...cleanCss.minify(sorted),
included: sorted ? sorted.map((m) => Object.keys(m)[0]) : [],
};

Which is called after the build.

To fix this, we have to process @import statement in the transform function and set imported files as dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants