aweb's avatar
Level 4

Using esbuild similar to Laravel Mix

esbuild is is much faster than Laravel Mix.

Does anyone know how to convert following settings to esbuild similar to Laravel Mix as much as possible. I need two commands: prod and watch

.js(vueJS + 'app1.js', target)
.js(vueJS + 'app2.js', target)
.js(vueJS + 'app3.js', target)
.js(vueJS + 'app4.js', target)
.js(vueJS + 'app5.js', target)
.js(vueJS + 'app6.js', target)
.js(vueJS + 'app7.js', target)
.js(vueJS + 'app8.js', target)
0 likes
1 reply
aweb's avatar
Level 4

How to build a similar js function for esbuild

const builder = require('esbuild');

builder.buildSync({
    entryPoints: [vueJS + 'app1.js'],
    bundle: true,
    // minify: true,
    outfile: 'app1.js',
})

builder.buildSync({
    entryPoints: [vueJS + 'app2.js'],
    bundle: true,
    // minify: true,
    outfile: 'app2.js',
})

builder.buildSync({
    entryPoints: [vueJS + 'app3.js'],
    bundle: true,
    // minify: true,
    outfile: 'app3.js',
})

Please or to participate in this conversation.