Skip to content

Commit

Permalink
perf: keep js builder
Browse files Browse the repository at this point in the history
  • Loading branch information
nobkd committed Oct 8, 2024
1 parent 6213843 commit 0340d92
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/nuekit/src/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down

0 comments on commit 0340d92

Please sign in to comment.