Skip to content
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

How to automatically compile bundle in debug mode when any changes occur #202

Open
nhaberl opened this issue Jan 23, 2024 · 1 comment
Open
Labels

Comments

@nhaberl
Copy link

nhaberl commented Jan 23, 2024

Hi,

we are using Umbraco 10 including smidge for client side js and less/css bundling.
What we run into trouble is when changing any js file which is in a bundle we cannot access the "fresh" code in the browser ... it stys like the bundle was defined on startup.

So my question is how can we achive at least for development that any changes occur triggers a rebuild and we can access the new bundle?

Our code we use now on startup

`services.AddSmidge(_config.GetSection("smidge"));
services.Configure(options =>
{
string cachebuster = _config.GetSection("Umbraco:CMS:RuntimeMinification").GetValue("CacheBuster") ?? "AppDomain";
Type cacheBusterType = Enum.Parse(cachebuster) switch
{
RuntimeMinificationCacheBuster.AppDomain => typeof(AppDomainLifetimeCacheBuster),
RuntimeMinificationCacheBuster.Version => typeof(ConfigCacheBuster),
RuntimeMinificationCacheBuster.Timestamp => typeof(TimestampCacheBuster),
_ => throw new NotImplementedException(),
};

options.DefaultBundleOptions.DebugOptions.FileWatchOptions.Enabled = true;
options.DefaultBundleOptions.DebugOptions.SetCacheBusterType(cacheBusterType);
options.DefaultBundleOptions.ProductionOptions.SetCacheBusterType(cacheBusterType);
options.DefaultBundleOptions.ProductionOptions.ProcessAsCompositeFile = true;

});`

Any suggestions welcome
Thanks

@Shazwazza
Copy link
Owner

Are you referring to back office or front-end assets?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants