Skip to content
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

Compilation of dependent less files on build seems not to be working #195

Open
KernelLeak opened this issue Feb 17, 2016 · 4 comments
Open

Comments

@KernelLeak
Copy link

Version 1.10 has "Sass/LESS dependent file support" as a new feature, but it seems something isn't working as I'd expect it to do:

We have a file called "bootstrap.less" with the following contents:

@import "bootstrap/bootstrap.less";
@import (css) "moment-datepicker/datepicker.css";
@import "ikt.less";
@import "kfs.less";

where the bootstrap folder contains the bootstrap LESS sources, ikt.less contains some general styles for all our apps and kfs.less are styles specifically for this project.

Currently, when I update our project from git and there is a change in ikt.less (or I edit ikt.less outside of VS) our bootstrap.less is not being recompiled on a "regular" build command in VS, I have to explicitly do a rebuild to get bootstrap.css to be regenerated.

Our compilerconfig.json contains only the following:

[
  {
    "outputFile": "Content/bootstrap.css",
    "inputFile": "Content/bootstrap.less"
  }
]

since we don't want any of the other less files to be compiled on their own. And yes, "Enable compile on build..." is checked in the compilerconfig.json context menu.

Should it really work this way?

@madskristensen
Copy link
Owner

I just uploaded a new version of the extension.

You can call Alt+Shift+Y to recompile all files. After pulling latest files from source control can sometimes confuse the extension. Recompiling all files should fix it.

@KernelLeak
Copy link
Author

Well, I just now tried Alt-Shift-Y after adding a "background-color: red" using a text editor outside of Visual Studio to the body style in ikt.less which should be glaringly obvious, but neither a regular build nor "Recompile all files" did anything; the page background was still all white.

Shouldn't Alt-Shift-Y kinda act like "Rebuild all", but just for the files WebCompiler cares about?

@gregtayl
Copy link

gregtayl commented Apr 5, 2016

We are experiencing the same issue with dependent files in SASS.

When external changes are made to a dependent scss file (imported in the main site.scss) the BuildWebCompiler target (invoked by building the solution) does NOT automatically recompile the css. Cleaning/rebuilding the solution does however appear to recompile the css (since the generated css files are deleted as part of the clean in 1.10.310, this didn't seem to be the case in 1.10.306). Using the Visual Studio extension (right clicking site.scss and choosing Web Compiler -> Re-compile File) does appear to recompile the css.

If external changes are made directly to the main site.scss (instead of a dependent imported file), then simply building the solution (without cleaning or rebuilding) does recompile the css.

@dotcentric-samb
Copy link

I am experiencing the same issue with a solution i am working on. We have a sass file screen.sass (that compiles into screen.css) which imports other sass files, such as elements.sass. On a normal build it seem that the compiler will not look in elements.sass for changes, only screen.sass. So if I update elements and want it compiled into screen.css I have to either open and save screen.sass or re-build the project.

Does anyone have a solution? I’d love to be able to just recompile all the sass on every build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants