WebOptimizer
WebOptimizer copied to clipboard
A bundler and minifier for ASP.NET Core
I'm actually migrating a big legacy app from .Net 4.6 to .Net 5. So for bundling and minification I'm using this package as its a great alternative to classic bundling...
```csharp // Add a bundle of some pre-minified files pipeline.AddJavaScriptBundle( "/js/bundle.min.js", "/lib/jquery/jquery.min.js", "/lib/jquery-something/jquery-something.min.js"); // minify my site.js pipeline.MinifyJsFiles("/js/site.min.js", "/js/site.js"); // NESTED bundle with both of the above. pipeline.AddJavaScriptBundle("/js/nested-bundle.min.js", "/js/bundle.min.js", "/js/site.min.js");...
configuration: ``` services.AddWebOptimizer(pipeline => { pipeline.MinifyCssFiles();; pipeline.MinifyJsFiles();; pipeline.AddCssBundle("/css/style.css", "**/*.css"); pipeline.AddJavaScriptBundle("/js/script.js", "**/*.js"); }); ``` And I can see the code comments on the files are still exist: ``` /*! * Bootstrap...
The _fileversionprovider variable is static in the Asset class, and it's initialized off the FIRST call to GenerateCacheKey using the _current_ asset's FileProvider. Everything is okay as long as you...
https://github.com/ligershark/WebOptimizer/blob/32708323bd53836b4a43837b0f8b80673c9db736/src/WebOptimizer.Core/Taghelpers/LinkTagHelper.cs#L102 Otherwise, how will the link work? Imagine that I have ``` C# pipeline .AddScssBundle(options, "/SecretCircle.BmwTheme/app.css", "Areas/SecretCircle.BmwTheme/wwwroot/styles/app.scss") .UseContentRoot(); ``` This means that the tag helper will rewrite `` to `
https://github.com/ligershark/WebOptimizer/blob/32708323bd53836b4a43837b0f8b80673c9db736/src/WebOptimizer.Core/Processors/CssFingerprinter.cs#L61 If dir is `null` on this line Exception occurs that breaks all SCSS compilation
I followed the sample and added a single JS file for minification: services.AddWebOptimizer(pipeline => { pipeline.MinifyJsFiles("Scripts/r/react.js"); }); However, accessing https://localhost:44393/Scripts/r/react.js results in: > FileNotFoundException: The file /Scripts/r/react.js does not exist....
https://github.com/ligershark/WebOptimizer/blob/0c0d4df11b839dbb9207490afd872fc9242abee2/src/WebOptimizer.Core/Processors/RelativePathAdjuster.cs#L27 can cause System.ArgumentNullException: 'Value cannot be null. ' According to https://stackoverflow.com/a/37988320/2484903 this can happen if wwwroot was removed. To make WebOptimizer more robust, considering using `env.WebRootPath ?? string.Empty`
Hi, I currently use bootstrap 4 and wish to use a custom there that I got from here: https://bootswatch.com/litera/ So, I use the following line to compile the SCSS: ```...
Use new .net5 feature Code Generator to implement the minification at compile time and not at build time