Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ compile_commands.json
data/tpch/**/*.parquet
.idea
lib/.idea

check_duckdb
wasm_setup
loadable_extensions/*.wasm
5 changes: 5 additions & 0 deletions packages/duckdb-wasm/bundle.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import path from 'path';
import { rimrafSync } from 'rimraf';
import mkdir from 'make-dir';
import { fileURLToPath } from 'url';
import { execSync } from 'child_process';

// -------------------------------
// Current bundling strategy
Expand Down Expand Up @@ -195,6 +196,10 @@ fs.copyFile(path.resolve(src, 'bindings', 'duckdb-coi.wasm'), path.resolve(dist,
});

console.log('[ ESBUILD ] duckdb-browser-coi.worker.js');
// Don't attempt to bundle NodeJS modules in the browser build.
execSync(
`sed -i.bak 's/require("vm")/["vm"].map(require)/g' ./src/bindings/duckdb-coi.pthread.js && rm ./src/bindings/duckdb-coi.pthread.js.bak`,
);
await esbuild.build({
entryPoints: ['./src/targets/duckdb-browser-coi.worker.ts'],
outfile: 'dist/duckdb-browser-coi.worker.js',
Expand Down