excubo-ag / WebCompiler

Apache License 2.0
149 stars 30 forks source link

compiler output directory and preserve #30

Closed Crare closed 3 years ago

Crare commented 3 years ago

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

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.

Crare commented 3 years ago

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
  },
stefanloerwald commented 3 years ago

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

stefanloerwald commented 3 years ago

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