irispixel / vscode-dartsass

VSCode plugin using dart sass compiler
https://irispixel.com
10 stars 3 forks source link

Sass Bin Path with spaces in windows #12

Closed xxvii closed 2 years ago

xxvii commented 3 years ago

Hello, my user directory has a space in it (C:\Users\Name Surname\AppData\Roaming\npm\node_modules\sass) so the path doesn't work, even if I enclose it in quotes. I can't use the file watcher in this way, which is very inconvenient.

Please solve this, thank you.

PS: is the developer (and the plugin) still alive?

akkumar commented 3 years ago

my user directory has a space in it (C:\Users\Name Surname\AppData\Roaming\npm\node_modules\sass) so the path doesn't work, even if I enclose it in quotes.

Can you try sassbinPath to be node_modules\\sass\\sass.js if it is in windows ? ( See https://github.com/codelios/vscode-dartsass#dartsasssassbinpath for more details ).

It may work.

PS: is the developer (and the plugin) still alive?

Well - luckily yes to both . Although the recent pandemic has certainly distracted my attention away from this for sometime. Apologies for that. I will be more proactive on this from here on.

xxvii commented 3 years ago

Hello @akkumar, I'm glad to hear that both the plugin and you are alive and well ;) I didn't mean to be rude, I was just wondering if the plugin was currently mantained, I'm sorry if I sounded irrespectful.

Anyway, changing the Sass Bin Path to C:\Users\Name Surname\AppData\Roaming\npm\node_modules\sass\sass.js seems to work, however I still have a problem.

I created two files /style.scss (containing @import "scss/partial";) /scss/_partial.scss and added a watcher to the root directory.

If I edit style.scss, both normal and minified files (css and map) are created (or updated), but if I edit _partial.scss only the normal files are created (or updated). The minified files are not created (or updated if already present)

The Target Directory setting is empty

akkumar commented 3 years ago

I am transferring this issue from the library to the project for plugin herewith.

akkumar commented 3 years ago

If I edit style.scss, both normal and minified files (css and map) are created (or updated), but if I edit _partial.scss only the normal files are created (or updated). The minified files are not created (or updated if already present) The Target Directory setting is empty

I guess only one watcher process gets launched.

Since otherwise - if there were 2 processes launched in the background , one for normal css and another for minified css with the same target directory , I am going to assume extremely unpredictable things will happen for the target files as both the processes will try to write to the same file with the same extension.

So - this seems to be - by design though.

xxvii commented 3 years ago

Since otherwise - if there were 2 processes launched in the background , one for normal css and another for minified css with the same target directory , I am going to assume extremely unpredictable things will happen for the target files as both the processes will try to write to the same file with the same extension.

I don't understand...the normal files and the minified files have different names as style.css and style.min.css are different files...why should it be a problem? Moreover, if I edit the "main" file the process works, if I edit an imported files it does not? It doesn't make much sense to me...

So - this seems to be - by design though.

By design of what?

akkumar commented 3 years ago

I don't understand...the normal files and the minified files have different names as style.css and style.min.css are different files

So - when we "save" a scss file inside the vscode ide - the plugin auto-specifies the output file name with a .min.css suffix and saves in that name.

But - when we launch a watcher process - "Watch a Directory" , it actually launches a sass --watch inputdir:outputdir process that does all the work.

We can specify only the output directory to that cmd line option but there is no way to specify the name / extension of the output files in the output directory.

But hypothetically - if during a "watch" - we want both minified and normal files to be written - 2 external processes need to be launched but both of them will end up trying to write to the same output file ( there is no way to specify .min.css - as far as "watcher processes" are concerned ). That is the race condition I was referring to.

Hence by design only the normal or minified files gets generated from a watcher at any given time. but not both.

xxvii commented 3 years ago

Uhm...I see... So, I think that https://github.com/codelios/vscode-dartsass/issues/13 makes even more sense now

akkumar commented 3 years ago

So, I think that #13 makes even more sense now

I understand that. But that will deprecate some properties like "disableMinifiedGeneration" etc. So trying to make sure everything is correct before it gets rolled out.

It may take a week or so before it gets rolled out just so it gets properly tested.

akkumar commented 3 years ago

The fix mentioned #13 is now present.

0.7.4 of the plugin adds a new property called outputFormat that helps provide this flexibility.

README contains more details of the same.

akkumar commented 2 years ago

With #13 present and closed - can I close this as well ?