Statiq does not see pipelines after engine.Pipelines.Clear() #144
-
I have made a simple pipeline to better understand how Statiq works and I have an issue with this code : This code works fine, Statiq use my pipeline await Bootstrapper
.Factory
.CreateDefault(args)
.AddPipeline<MyPipeline>()
.RunAsync(); This code does not work, Statiq does not see it
await Bootstrapper
.Factory
.CreateDefault(args)
.ConfigureEngine(engine =>
{
engine.Pipelines.Clear();
})
.AddPipeline<MyPipeline>()
.RunAsync(); Basically, I was trying to remove all default pipelines from Statiq.Web and see how my pipeline was doing. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
At first glance I think what's going on here is that the fluent pipeline configuration methods like To do what you want, the trick here is to call Did all that make sense? |
Beta Was this translation helpful? Give feedback.
At first glance I think what's going on here is that the fluent pipeline configuration methods like
AddPipeline
work by adding the specified pipeline to the dependency injection container, which the engine then uses to get pipelines when it's created. The confusing part here is that the fluent methods aren't necessarily called in the order they're specified in the chain (I.e. they're all lazy). All theAddPipeline()
and related methods do their work before theConfigureEngine()
call, even if they're called later in the fluent chain. So in your second example, theMyPipeline
pipeline does get added, it just gets removed again inside theConfigureEngine()
call.To do what you want, the tric…