WordPress savePath not compiling to correct folder
See original GitHub issueIβm using Live Sass Compiler in WordPress, but I canβt seem to figure out the correct settings.
Iβve tried to edit the liveSassCompile.settings.formats
in User > settings.json. Here is the relevant section:
"liveSassCompile.settings.formats": [
{
"format": "expanded",
"extensionName": ".css",
"savePath": "/wp-content/themes/humescores/",
"savePathReplacementPairs": null
}
],
"liveSassCompile.settings.generateMap": false,
I need all the .scss files in the current themeβs βsassβ folder to compile into the style.css file in the theme root. Here is what my project folder structure looks like:
website_prj/
βββ wp-content/
βββ themes/
βββ humescores/
β βββ sass/
β β βββ style.scss
β β βββ _other.scss
β β βββ partials/
β βββ style.css
βββ twentyseventeen/
βββ twentytwentyone/
Instead, I have .css files ending up all over in different folders and somehow the humescores style.css file is compiling from the twentytwentyone theme folder.
I have tried changing savePath to various versions of ~
, ~/
, /~
, /**
, **/
, /
, ../
β but, none of these methods worked.
How can I get all SCSS files in only the current theme folder to compile in the βsassβ folder, with the destination being the theme root (the humescores folder, for instance)?
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Glad you got it working!
Closing as resolved
Thanks for all your help @glenn2223! I set the trace and here is the output:
After I last posted I kept tinkering to try to get the settings right. It seems like I got closer and closer, but no cigar yet. But, through my experimenting I was able to refine my requirements in my own mind. So, please allow me to describe the results I am seeking.
humescores/scss/
directory be compiled, regardless of which subfolder they may live in tohumescores/scss/style.scss
.humescores/style.css
Well now, it seems to be working. I guess Iβll leave this comment for others to learn from. This is the contents of my
.vscode/settings.json
file:And here is an abbreviated version of my folder structure. Note the nested levels and that
.vscode/
folder is a direct child of the WordPress theme folder βhumescoresβ:Here are some quick observations that may help others: