Code Monkey home page Code Monkey logo

Comments (7)

mikes-gh avatar mikes-gh commented on August 10, 2024

Another design could be SourceTargetPairs []

Its not my use case but is more flexible.

{
  "SourceTargetPairs": [
  {
    "Source": "Styles/MudBlazor.scss",
    "Target": "wwwroot/MudBlazor.min.css"
  },
  {
    "Source": "Styles/MudBlazor1.scss",
    "Target": "wwwroot/MudBlazor1.min.css"
   }]
"Arguments": "--style=compressed",
}

from aspnetcore.sasscompiler.

sleeuwen avatar sleeuwen commented on August 10, 2024

Hi @mikes-gh,
We directly pass the arguments to the dart-sass executable that does the conversion and creates the .css file. This does however mean that if you use a folder as the source you can't specify the resulting filename. You currently can already specify a filename for both SourceFolder and TargetFolder and I think that should work the same, however I agree it is confusing to have Folder in the setting.

I've wanted to allow multiple source/target folders/files so I think the approach in the last comment, at that point we can also allow different arguments per folder (and have the arguments outside of the pairs be the default if it is not specified for a specific pair). I'll try to create something for this in the coming days.

from aspnetcore.sasscompiler.

jclementEIT avatar jclementEIT commented on August 10, 2024

@sleeuwen Did you ever allow multiple sources and targets? I don't see anything explicitly about that in the readme. This would be ideal for my project where some files need to go in a wwwroot/css folder but others need to live in a wwwroot/lib folder.

from aspnetcore.sasscompiler.

mikes-gh avatar mikes-gh commented on August 10, 2024

@sleeuwen

You currently can already specify a filename for both SourceFolder and TargetFolder and I think that should work the same, however I agree it is confusing to have Folder in the setting.

AFAICS Specifying a source filename gives an error that its not a folder. It would be great if I could compile direct to a min.css filename as currently I have to add a target in my build for that and its a bit messy.

The output even if setting compressed is still plain .css which is confusing as not many ppl have a minified css without a min in the filename

from aspnetcore.sasscompiler.

mikes-gh avatar mikes-gh commented on August 10, 2024

would you accept a PR for the SourceTargetPairs design or SourceTarget?

from aspnetcore.sasscompiler.

mikes-gh avatar mikes-gh commented on August 10, 2024

Or an even simpler PR for MinifiedFileExtension?

from aspnetcore.sasscompiler.

mikes-gh avatar mikes-gh commented on August 10, 2024

Hi @mikes-gh, We directly pass the arguments to the dart-sass executable that does the conversion and creates the .css file. This does however mean that if you use a folder as the source you can't specify the resulting filename. You currently can already specify a filename for both SourceFolder and TargetFolder and I think that should work the same, however I agree it is confusing to have Folder in the setting.

I've wanted to allow multiple source/target folders/files so I think the approach in the last comment, at that point we can also allow different arguments per folder (and have the arguments outside of the pairs be the default if it is not specified for a specific pair). I'll try to create something for this in the coming days.

@sleeuwen We are going to create this feature in our own fork since we need it now. I would be happy to contribute it back to the original repo and use that, as our preference would be to continue to support this excellent body of work. Let me know if you're interested.

from aspnetcore.sasscompiler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.