Hi! For a toy project of mine I used koa-views, which uses consolidate, and noticed that the way consolidate does requires chokes up esbuild --bundle, causing me to have to manually mark every single template engine I'm not using as external, which in esbuild means it won't care for them.
This however is quite a chore and if there's ever a change in the supported engines will mean I'll have to update this list by hand which is ... not ideal.
One way I thought could potentially work -and will likely test for viability shortly- is abstracting the require calls such that the bundling tools no longer get confused about all those conditional calls?
I created evanw/esbuild#2033 over at esbuild so someone can at some point have a shot at solving it, but also wanted to let y'all know this is a thing that happens.
Cheers!
Hi! For a toy project of mine I used
koa-views, which usesconsolidate, and noticed that the wayconsolidatedoes requires chokes upesbuild --bundle, causing me to have to manually mark every single template engine I'm not using asexternal, which inesbuildmeans it won't care for them.This however is quite a chore and if there's ever a change in the supported engines will mean I'll have to update this list by hand which is ... not ideal.
One way I thought could potentially work -and will likely test for viability shortly- is abstracting the
requirecalls such that the bundling tools no longer get confused about all those conditional calls?I created evanw/esbuild#2033 over at
esbuildso someone can at some point have a shot at solving it, but also wanted to let y'all know this is a thing that happens.Cheers!