ligershark / WebOptimizer

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

enableTagHelperBundling=false not working for scss files #264

Open jamezamm opened 1 year ago

jamezamm commented 1 year ago

Hi,

When declaring the below scss bundle pipe.AddScssBundle("/css/site.bundle.css", "/lib/jqueryui/jquery-ui.min.css", "/lib/bootstrap/scss/bootstrap.scss");

then disabling enableTagHelperBundling in appsettings.json "enableTagHelperBundling": false

it gets rendered as bootstrap.css, not bootstrap.scss <link href="/lib/jqueryui/jquery-ui.min.css?v=rByPlHULObEjJ6XQxW_flG2r-22R5dKiAoef-aXWfik" rel="stylesheet"> <link href="/lib/bootstrap/scss/bootstrap.css" rel="stylesheet">

In my case "/lib/bootstrap/scss/bootstrap.css" does not exist, therefore the browser throws a 404 not found.

Any ideas?

jamezamm commented 1 year ago

I have found this closed issue (https://github.com/ligershark/WebOptimizer.Sass/issues/2) and I can see that the code was explicitly altered to change extension from .scss to .css. This was done in commit https://github.com/ligershark/WebOptimizer/commit/6ae221a5d04a6179125be9737ece7c8d6387d3f9 (Code below) https://github.com/ligershark/WebOptimizer/blob/06e4deae29afe06237d5111ef8353061ee5f6563/src/WebOptimizer.Core/Taghelpers/LinkTagHelper.cs#L99-L104

I do not understand how this would work in any scenario. Am I missing something?

s3YwCf2ZbfJG4SHAfjQMAjtsf commented 1 year ago

IMO, enableTagHelperBundling should load the css bundles so the browser works or the scss with the mapping.

The pages fail because we would have to reference each scss file accordingly on the page. Shouldn't enableTagHelperBundling work like Typescript vs Javascript mapping? Browser runs the javascript but makes the Typescript visible to debug with.