Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
277 views
in Technique[技术] by (71.8m points)

node.js - How to set up dir watching with DartJS Sass in VS Code?

I'm transitioning from Brackets/LESS to VS Code/SASS and I'm having trouble getting the tooling working. I've installed DartJS Sass Compiler and it seemed to work well but I wanted it to compile the whole project anytime I saved instead of only the file I was saving. Reading around, I gathered that I needed stand-alone installations of Node.js and Dart SASS. So I grabbed the x64 Windows installer for Node.js and installed it. It appeared to have come with NPM, so I ran npm install -g sass from the dir where Node was installed. It also installed chocolatey. These didn't provide the dart.exe file the DartJS extension was looking for so I ran choco install dart-sdk as well. In the extension settings, I set "dartsass.nodeExePath": "C:\PROGRA~1\nodejs\node.exe" and "dartsass.sassBinPath": "C:\tools\dart-sdk\bin\dart.exe". Those files do exist at those locations and after doing this I stopped getting errors when saving in a watched dir.

But now the extension doesn't seem to work at all. The output console indicates that it is, in fact, watching the directory I told it to watch and I can't set a watcher any higher up the dir chain (which would be the project root). When I save a file while watching this dir I get no errors at all but no CSS files are generated either, even when I save the global file. If I stop watching the dir and save, or if I save without ever starting the watcher, I get the error "Process exited with code: 1" which I can find no information about. I'm not sure if the problem is with the DartJS Sass extension or with VS Code itself but I've googling from both angles with no success.

However, I can run sass --watch sass:css in my project root from the command prompt and this works fine.

What did I screw up?

question from:https://stackoverflow.com/questions/66067267/how-to-set-up-dir-watching-with-dartjs-sass-in-vs-code

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...