-
Notifications
You must be signed in to change notification settings - Fork 355
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
Watch not watching all files? #1672
Comments
try using this {
"watch": "sass build/*.scss -w public/css/"
} Also, did you install JavaScript compiled version of |
@KunalTanwar I simply installed sass via npm: npm install sass --save-dev So it's the javascript version. Also running this script: sass build/sass/*.scss -w wwwroot/public/css/ gives an error: |
For the completeness, this is the file structure: And this is the complete packages.json: { |
{
"scripts": {
"build-sass": "sass build/sass:wwwroot/public/css",
"postbuild-sass": "postcss wwwroot/public/css/.css -u autoprefixer",
"build-production-sass": "sass build/sass:wwwroot/public/css",
"postbuild-production-sass": "postcss wwwroot/public/css/.css -u autoprefixer cssnano -r --no-map",
"watch-sass": "sass --watch build/sass:wwwroot/public/css"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^13.2.0",
"autoprefixer": "^10.4.4",
"cssnano": "^5.1.5",
"postcss-cli": "^9.1.0",
"sass": "^1.50.0"
},
"-vs-binding": {
"ProjectOpened": ["watch-sass"]
}
} I think in your "build-sass": "sass build/sass/example.scss wwwroot/public/css" then you will import your example.scss @import './Test/partial';
// rest of your code FYI - You should have opened this issue in sass repo because |
Hi @KunalTanwar, thanks for the effort to reply :) Let me address your remarks:
|
Hey @Luuk1983 first of thanks for informing me about |
Sorry for the delay on responding to this. I notice that the directory itself is called |
Hello everyone, I ran into the same issue today and hard a time finding the bug. I made a repro just to be sure, you can see it here : https://gitlab.com/monsieurman/dart-sass-not-watching-test. In our build, we have partial files contributed by a lot of different folders, and they end up compiled in the same file at the end. The repro does the same but simply, I made an automatic test case (test.js) which you can see run here : https://gitlab.com/monsieurman/dart-sass-not-watching-test/-/jobs/6869352619 This leads to the question, is wanted the watch does not look at dependencies, or is it something you'd want to fix? Thanks |
@MonsieurMan It is intentional that |
Very clear response, thanks! You also pointed to the fact we can just use Edit: I could've read the doc more thoroughly, it's already written here that the watch does not look for @import, @use, etc, and watch for load-path. |
I recently asked how the watch should work: #1666. Based on this information, I'm unable to make the watch work as described there. Maybe I'm missing something, or maybe where is a bug somewhere so I thought I'd explain my example.
I'm running Sass 1.49.9.
My file structure is:
_partial.scss contains some test stuff:
example.scss contains:
I created an NPM script to start the watch:
Now when I run the script, the watch starts without problems and when I change something in the example.scss file, it will immediately recompile. However, when I make changes to _partial.scss, it will not pick up on the changes and not recompile the example.scss.
Even worse, when I change something in _partial.scss and it doesn't compile, when I then change something in example.scss, it will compile example.scss, but the changes done to _partial.scss that were done before are not reflected in the recompiled example.scss. Maybe it doesn't consider _partial.scss changed or something?
So I'm puzzled thy this is not working because it's such a simple example and you're posts suggests this should work. Thank you for your reply in advance once again.
The text was updated successfully, but these errors were encountered: