ligershark / WebOptimizer

A bundler and minifier for ASP.NET Core
Apache License 2.0
753 stars 113 forks source link

If Foo.js and Foo.min.js both match a glob, skip one of those files #220

Open danielgreen opened 2 years ago

danielgreen commented 2 years ago

Scenario: I have imported a library into my repo, where the library provides pre-minified js and css files.

I want to set up js and css bundle using a globbing pattern e.g. lib/foo/**/*.js and lib/foo/**/*.css. At the moment, this will pick up all files with those extensions and result in duplicated js & css because both the minified and non-minified files are picked up.

Could WebOptimizer recognise that we're unlikely to want both foo.js and foo.min.js in the bundle and only pick one of them? Otherwise the developer is forced to exclude one of those files from the repo, or write additional code (such as a more complicated globbing pattern) to ensure only one of them is include in the bundle.