excubo-ag / WebCompiler

Apache License 2.0
148 stars 29 forks source link

Force re-compile all scss in the project #91

Open shv07 opened 4 months ago

shv07 commented 4 months ago

Hi,

Is there a way to force recompilation of all the scss files in the project? Due to some reason, some of my scss files are not getting compiled to css (they already have the compiled css from previously used library). Or if we can increase the verbosity of the compilation logs to check which files are getting compiled, etc?

stefanloerwald commented 4 months ago

This is currently unsupported. The tool determines if files need compilation based on file timestamps. See https://github.com/excubo-ag/WebCompiler/blob/main/WebCompiler%2FCompile%2FSassCompiler.cs#L46

I wouldn't recommend using an override here though: if recompilation was truly required, then the logic here is flawed and should be fixed.

shv07 commented 4 months ago

Thanks.

But, the same scss gets compiled and css gets generated if the minifier is enabled.

And for the same scss, the css is not generated if minifier is disabled, unless I make some change in the scss again (I need only the compilation though without any minification)

Here is the config I am using:-

{
  "Minifiers": {
    "GZip": false,
    "Enabled": true,
    "Css": {
      "CommentMode": "Important",
      "ColorNames": "Hex",
      "TermSemicolons": true,
      "OutputMode": "SingleLine",
      "IndentSize": 2
    }
  },
  "Autoprefix": {
    "Enabled": true,
    "ProcessingOptions": {
      "Browsers": [
        "last 4 versions"
      ],
      "Cascade": true,
      "Add": true,
      "Remove": true,
      "Supports": true,
      "Flexbox": "All",
      "Grid": "None",
      "IgnoreUnknownVersions": false,
      "Stats": "",
      "SourceMap": true,
      "InlineSourceMap": false,
      "SourceMapIncludeContents": false,
      "OmitSourceMapUrl": false
    }
  },
  "CompilerSettings": {
    "Sass": {
      "IndentType": "Space",
      "IndentWidth": 2,
      "OutputStyle": "Expanded",
      "RelativeUrls": true,
      "LineFeed": "Lf",
      "SourceMap": false
    },
    "Ignore": [
      "**/_*.*",
      "**/js/**",
      "**/ThirdParty/**"
    ]
  },
  "Output": {
    "Preserve": true
  }
}
stefanloerwald commented 4 months ago

In that case, I need a minimal example that reproduces this issue reliably. Otherwise I can't do anything to help...

shv07 commented 4 months ago

On closer inspection, I found my already existing css file had a newer timestamp compared to the scss. This could have prevented the compilation of scss again when minification was disabled.

The already existing min.css and css files have the same timestamp.

This scenario used to work fine with madskristensen/WebCompiler. I will try to figure out some workaround since this tool does the compilation strictly on the basis of timestamp.