excubo-ag / WebCompiler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compiler output directory and preserve

Crare opened this issue · comments

Hi,
My project still outputs styles.css inside Styles-folder, even though preserve is false. Also, shouldn't it be outputting all the files in the output directory?

my project structure:

root of project

  • wwroot
    • css
      • styles.min.css
  • Styles
    • styles.scss
  • ...

webcompilerconfiguration.json:

{
  "Minifiers": {
    "GZip": false,
    "Enabled": true,
    "Css": {
      "CommentMode": "Important",
      "ColorNames": "Hex",
      "TermSemicolons": true,
      "OutputMode": "SingleLine",
      "IndentSize": 2
    }
  },
  "CompilerSettings": {
    "Sass": {
      "IndentType": "Space",
      "IndentWidth": 2,
      "OutputStyle": "Nested",
      "Precision": 5,
      "RelativeUrls": true,
      "LineFeed": "Lf",
      "SourceMap": false
    }
  },
  "Output": {
    "Preserve": false,
    "Directory": "./wwwroot/css/"
  }
}

and running webcompiler afterbuild or manually:

dotnet tool run webcompiler Styles/styles.scss -c webcompilerconfiguration.json

PS. it is unclear in the readme getting started that how you setup output directory, it is nullable and it's not created in the json by default (because of that nullable I guess). Looked up the source and there it was https://github.com/excubo-ag/WebCompiler/blob/main/WebCompiler/Configuration/Config.cs Maybe add info on the readme how to set it up too.

okey adding disable for autoprefix removes the extra styles.css. (but it was not in output directory though..)

adding this disable to webcompilerconfiguration.json fixed it:

"Autoprefix": {
    "Enabled": false
  },

Hi @Crare,

I personally don't use the output directory functionality, nor the config json, so I didn't ever notice things being poorly documented. Since you now worked it out, would you mind submitting a pull request adding the information that you would have needed?

Regarding the issue of preserve: false still emitting the css file in the input directory: that sounds like a bug. I'll have a look at that later today.

BR
Stefan

I found the issue and fixed it in v2.7.1, which should become available within the next half hour. Thanks for reporting it!