You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We heavily use js plugins on top of esbuild to build complex projects(less、css module、postcss and so on),
esbuild is much faster than webpack in first full build, but esbuild is not faster than webpack on incremental rebuild since webpack has nice cache strategy for incremental rebuild.
take loader for example, which supports cacheable, which is true by default,
it can heavily reduce the cost in rebuild(this loader hooks is not called for unmodified file), and parcel has similar api cache-invalidation,
I'm wondering whether esbuild could provides similar api for cache invalidate management.
even though we could implement some cache strategy in js plugin, but it still takes some cost of go|js communication, which could be reduced by esbuild's internal cache invalidation.
constlessPlugin={name: 'lessPlugi',setup(build){build.onLoad({filter:/\.less$/,args=>{constcontents=lessRender(args);return{contents,cacheable: true// the js plugin will never be called for unmodified less file}})}}
The text was updated successfully, but these errors were encountered:
Even I caching every result of onResolve and onLoad, the plugin communication for large project is too high, so without caching strategy in esbuild it self, it seems not possible to solve incremental performance problem.
In myproject, incremental rebuild needs to call 15651 plugin, even though the plugin does nothing, the plugin communication costs 800ms in my mac.
so it seems that current incremental solution may not scale well.
We heavily use js plugins on top of esbuild to build complex projects(less、css module、postcss and so on),
esbuild is much faster than webpack in first full build, but esbuild is not faster than webpack on incremental rebuild since webpack has nice cache strategy for incremental rebuild.
take
loader
for example, which supports cacheable, which is true by default,it can heavily reduce the cost in rebuild(this loader hooks is not called for unmodified file), and parcel has similar api cache-invalidation,
I'm wondering whether esbuild could provides similar api for cache invalidate management.
even though we could implement some cache strategy in js plugin, but it still takes some cost of go|js communication, which could be reduced by esbuild's internal cache invalidation.
The text was updated successfully, but these errors were encountered: