New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Whilst I can get filewatching for JS to work happily, same settings for CSS isn't working? #206
Comments
my bad.. was a css cascading issue... removed all but my |
So native smidge works.. but in umbraco.. filewatcher seems to not work at all.. private readonly IBundleManager _bundles;
...
_bundles.CreateCss("test-bundle-2", "~/css/custom.css", "~/css/ig-theme.defaults.css")
.WithEnvironmentOptions(BundleEnvironmentOptions.Create()
.ForDebug(builder => builder
.EnableCompositeProcessing()
.EnableFileWatcher()
.SetCacheBusterType<ConfigCacheBuster>()
.CacheControlOptions(enableEtag: false, cacheControlMaxAge: 0))
.ForProduction(builder => builder
.EnableCompositeProcessing()
.EnableFileWatcher()
.SetCacheBusterType<ConfigCacheBuster>()
.CacheControlOptions(enableEtag: false, cacheControlMaxAge: 0))
.Build()
); @Shazwazza any pointers? Umbraco 13.2.0 + Smidge 4.2.0... looks like they are messing about with smidge, as the urls aren't ending with .css
|
In Umbraco, the backoffice Smidge implementation is entirely separate from the native (front-end) Smidge usage (if you want to use it). This is intentional so that the back office Smidge config and implementation doesn't affect how normal Smidge would execute on your front-end. This is why there is separate configuration for this specific to Umbraco (back office) https://docs.umbraco.com/umbraco-cms/reference/configuration/runtimeminificationsettings. You might try looking here https://github.com/umbraco/Umbraco-CMS/blob/contrib/src/Umbraco.Web.Common/RuntimeMinification/SmidgeRuntimeMinifier.cs |
yep.. though also tried overriding the builder...
And still no cache busting on fileWatching :-( |
Is it also not odd that setting
isn't respected by the native |
Is this for your front-end or back-end, again, they operate independently. I haven't looked at this integration for many years so unfortunately I can't pinpoint what you need to do. |
It is for my frontend (though just the umbraco mvc and not a headless implementation) Can I have a native smidge implementation for the front end? and leave the backoffice to be umbraco runtimeMinification? As seems to be overlapping eg smidgehelper gets backoffice settings? Although you are saying that I should be able to have an independent setup?? I'm guessing that they can't be truly independent as you'd not be able to avoid bundle named collisions? eg I can't have |
guessing this might be in the mix.. lots of alter smidge to umbraco requirements... public static IUmbracoBuilder AddRuntimeMinifier(this IUmbracoBuilder builder)
{
// Add custom ISmidgeFileProvider to include the additional App_Plugins location
// to load assets from.
builder.Services.AddSingleton<ISmidgeFileProvider>(f =>
{
IWebHostEnvironment hostEnv = f.GetRequiredService<IWebHostEnvironment>();
return new SmidgeFileProvider(
hostEnv.WebRootFileProvider,
new GlobPatternFilterFileProvider(
hostEnv.ContentRootFileProvider,
// only include js or css files within App_Plugins
new[] { "/App_Plugins/**/*.js", "/App_Plugins/**/*.css" }));
});
builder.Services.AddUnique<ICacheBuster, UmbracoSmidgeConfigCacheBuster>();
builder.Services.AddSmidge(builder.Config.GetSection(Constants.Configuration.ConfigRuntimeMinification));
// Replace the Smidge request helper, in order to discourage the use of brotli since it's super slow
builder.Services.AddUnique<IRequestHelper, SmidgeRequestHelper>();
builder.Services.AddSmidgeNuglify();
builder.Services.AddSmidgeInMemory(false); // it will be enabled based on config/cachebuster
builder.Services.AddUnique<IRuntimeMinifier, SmidgeRuntimeMinifier>();
builder.Services.AddSingleton<SmidgeHelperAccessor>();
builder.Services.AddTransient<IPreProcessor, SmidgeNuglifyJs>();
builder.Services.ConfigureOptions<SmidgeOptionsSetup>();
return builder;
} |
Is it that I need to extend the Smidge FileSystem to allow watching, although my files are in the wwwroot/css/ folder anyway? https://github.com/Shazwazza/Smidge/blob/develop/src/Smidge/SmidgeStartup.cs#L156
|
Cloning the project
and updating Startup.cs with
If I change
js\bundle2\b2.js
on a subsequent refresh of the page the message written out is updated.However, changing
/css/Bundle1/a2.css
on refresh the cache has not been busted?Is
EnableFileWatcher()
not available for css?The text was updated successfully, but these errors were encountered: