I'm creating javascript bundles dynamically by reading out embedded js files from assemblies, the problem I have is that the assemblies are loaded much later on in the custom booting code, so they aren't available in the ConfigureServices() method. Is there a way to lazy create the javascript bundles, almost on demand, or at least after the ConfigureServices() ?
Thanks
```
services.AddWebOptimizer(pipeline =>
{
var embeddedprovider = new EmbeddedFileProvider(assembly);
var jsfiles = embeddedprovider.GetDirectoryContents("").Where(x => x.Name.EndsWith("js")).Select(b => b.Name).ToArray();
if (jsfiles.Any())
{
var f = Path.GetFileName(assembly.Location).Split(".");
pipeline.AddJavaScriptBundle("/js/" + f[3].ToLower(), jsfiles)
.UseFileProvider(embeddedprovider);
}
}
Hi,
I'm creating javascript bundles dynamically by reading out embedded js files from assemblies, the problem I have is that the assemblies are loaded much later on in the custom booting code, so they aren't available in the ConfigureServices() method. Is there a way to lazy create the javascript bundles, almost on demand, or at least after the ConfigureServices() ?
Thanks