Skip to content

Conversation

@milanc
Copy link

@milanc milanc commented Mar 15, 2024

This is to address feature request I've created #96.

Behavior

Once extension is added to config file then all the files with that extension are compiled without need for adding them to the config.
Right click on the file with a configured extension will not have option to be removed from the compiler config.
Recompile all will also compile all files matching the extension.
Running the compilation from Task Explorer will compile all files matching the extension.
To avoid performance impact, folder scan for files matching extension is cached.
New files, added through visual studio, that match the extension will also be compiled.

Known Issue

If files are added outside visual studio while the project is open, we need to run recompile all for the file to be included in compilation.

With these changes the extension supports config file like this.

[
  {
    "outputFile": "*.razor.css",
    "inputFile": "*.razor.scss",
    "minify": {
      "enabled": false
    }
  },
  {
    "outputFile": "stest.css",
    "inputFile": "stest.scss"
  }
]

And task explorer shows this
image

@milanc milanc force-pushed the master-03-ext-wildcard-01 branch from 230ea44 to f2efe04 Compare April 4, 2024 07:33
/// Determines if the config is only an extension pattern - not real file to process.
/// </summary>
[JsonIgnore]
public bool IsExtensionPattern => this.InputFile?.StartsWith("*") ?? false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this instead just search anywhere for the wildcard character? Just thinking of cases like /MyFolder/*.less

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants