I found out about packer a couple of months ago and have been loving it, seriously! But I noticed build times can be quite slow, mostly because of babel, so I wanted to suggest using esbuild-loader for bundling/minifying via esbuild while still using packer::bundle() (so this could be the default bundling or just a parameter on packer::scaffold_golem()).
The modifications needed are very well explained at esbuild-loader's README.md, all it should take is:
Installing esbuild during packer's scaffold
Creating webpack.common.js with esbuild-loader imports and specific modifications to the options object
Creating loaders.json with the esbuild-loader configs instead of babel-loader
Hey man,
I found out about packer a couple of months ago and have been loving it, seriously! But I noticed build times can be quite slow, mostly because of
babel
, so I wanted to suggest usingesbuild-loader
for bundling/minifying viaesbuild
while still usingpacker::bundle()
(so this could be the default bundling or just a parameter onpacker::scaffold_golem()
).The modifications needed are very well explained at
esbuild-loader
'sREADME.md
, all it should take is:esbuild
duringpacker
's scaffoldwebpack.common.js
withesbuild-loader
imports and specific modifications to theoptions
objectloaders.json
with theesbuild-loader
configs instead ofbabel-loader
So
webpack.common.js
would look something like:And
loaders.json
should look like:This setup has been working wonderfully for me, I got the build time to go down from ~3.3min to ~12sec, so I'd love to see it implemented on
packer
!