BUG: css.proxy.js files do not receive updates with `snowpack build --watch`
Author: smnhgnCreated Oct 23, 2021Updated May 29, 2023
Quick checklist
- I am using the latest version of Snowpack and all plugins.
What package manager are you using?
npm
What operating system are you using?
Windows
Describe the bug
Projects which are set up with snowpack and @snowpack/plugin-sass and directly import sass files in js (or ts) will generate
css.proxy.js files in their build output.
With snowpack build --watch the css.proxy.js files will not receive updates after changes to the sass files.
Steps to reproduce
- set up project with snowpack and @snowpack/plugin-sass
- import sass file in js (or ts)
import "./index.scss" - run build with watch flag
snowpack build --watch - change contents of sass file (index.scss)
body { background: blue; }->body { background: red; } - check build output
- css output (index.css) received update
body { background: red; } - css proxy output (index.css.proxy.js) did not receive update
if (typeof document !== 'undefined') {
const code = "body {\n background: blue;\n}";
const styleEl = document.createElement("style");
const codeEl = document.createTextNode(code);
styleEl.type = 'text/css';
styleEl.appendChild(codeEl);
document.head.appendChild(styleEl);
}Link to minimal reproducible example (optional)
Source: FredKSchott/snowpack