Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for extension based config item#97

Open
milanc wants to merge 3 commits into
failwyn:master from
milanc:master-03-ext-wildcard-01
Open

Add support for extension based config item #97
milanc wants to merge 3 commits into
failwyn:master from
milanc:master-03-ext-wildcard-01

Conversation

@milanc

@milanc milanc commented Mar 15, 2024

Copy link
Copy Markdown

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

6rill2000 reacted with thumbs up emoji
@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;

@mstancombe mstancombe Apr 2, 2025

Copy link
Copy Markdown

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

Reviewers

1 more reviewer

@mstancombe mstancombe mstancombe left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /