Skip to content

Commit

Permalink
fix(client): replace dynamic import for wasm-worker-loader with sta…
Browse files Browse the repository at this point in the history
…tic export

Signed-off-by: Sora Morimoto <sora@morimoto.io>
  • Loading branch information
smorimoto committed Apr 7, 2024
1 parent 38a5147 commit 66f06e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/client/src/generation/generateClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ export async function buildClient({
// In short: A lot can be simplified, but can only happen in GA & P6.
fileMap['default.js'] = await JS(trampolineTsClient)
fileMap['default.d.ts'] = await TS(trampolineTsClient)
fileMap['wasm-worker-loader.js'] = `export default (await import('./query_engine_bg.wasm')).default`
fileMap['wasm-edge-light-loader.js'] = `export default (await import('./query_engine_bg.wasm?module')).default`
fileMap['wasm-worker-loader.js'] = `export { default } from './query_engine_bg.wasm'`
fileMap['wasm-edge-light-loader.js'] = `export { default } from './query_engine_bg.wasm?module'`
pkgJson['browser'] = 'default.js' // also point to the trampoline client otherwise it is picked up by cfw
pkgJson['imports'] = {
// when `import('#wasm-engine-loader')` is called, it will be resolved to the correct file
Expand Down

0 comments on commit 66f06e0

Please sign in to comment.