Search code examples
csssassazure-devopscontinuous-integrationweb-compiler

WebCompiler skipping an scss file in CI build


I have two scss files in my project that need to be compiled during my CI build (on Azure Pipelines). One is getting compiled when I build locally, and one is not. I'm using WebCompiler and the output to the log shows the one file that is working, but doesn't show any error for the missing file. My CI build is being handled by Azure Pipelines in the Devops suite and for some reason the CI build is working differently than the local build.

Originally I was missing the "Content" designation on the BuildAction for the file that doesn't get compiled. I have corrected that, but it still isn't getting compiled. I have confirmed the contents of the compilerconfig.json file and both files are there.

Here is the compilerconfig.json

[
  {
    "outputFile": "Content/custom-bootstrap.css",
    "inputFile": "Content/custom-bootstrap.scss"
  },
  {
    "outputFile": "Content/Site.css",
    "inputFile": "Content/Site.scss"
  }
]

And here is a snippet from the CI build Log file (originating from Azure Pipelines).

WebCompile:

  WebCompiler: Begin compiling compilerconfig.json
  WebCompiler installing updated versions of the compilers...
    Compiled Content/custom-bootstrap.css
    Minified Content/custom-bootstrap.min.css
  WebCompiler: Done compiling compilerconfig.json

And here is a snippet from a local build log.

5>  WebCompiler: Begin compiling compilerconfig.json
5>      Compiled Content/custom-bootstrap.css
5>      Minified Content/custom-bootstrap.min.css
5>      Compiled Content/Site.css
5>      Minified Content/Site.min.css
5>  WebCompiler: Done compiling compilerconfig.json

Any help would be greatly appreciated.


Solution

  • Solved my own issue...

    It looks like the WebCompiler, when running from the command line, will not overwrite an existing css file.

    I couldn't get the WebCompiler to compile this css within the context of my azure build so I left the css committed to my source code repo. Overwrite occured just fine in local builds. After leaving my project for a few months (no new development or deployments) I had a renewed interest in figuring this out. Turns out that removing the css file is now allowing WebCompiler to create the css for the deployment package. Not sure why I didn't try this long ago, but happy to be past this issue.