diff --git a/packages/nuekit/src/builder.js b/packages/nuekit/src/builder.js index d97da927..38795771 100644 --- a/packages/nuekit/src/builder.js +++ b/packages/nuekit/src/builder.js @@ -6,10 +6,12 @@ import { join } from 'node:path' import { resolve } from 'import-meta-resolve' import { Features, bundleAsync } from 'lightningcss' - +let jsBuilder export async function getBuilder(is_esbuild) { + if (jsBuilder) return jsBuilder + try { - return is_esbuild ? await import(resolve('esbuild', `file://${process.cwd()}/`)) : Bun + return jsBuilder = is_esbuild ? await import(resolve('esbuild', `file://${process.cwd()}/`)) : Bun } catch { throw 'Bundler not found. Please use Bun or install esbuild' }