Skip to content

Commit 1bfeb65

Browse files
committed
Bundle apache-arrow and d3 separately
This should (a) improve the load time for example who do not use D3 or Apache Arrow and limit issues with BigInt64Array to only examples using Apache Arrow.
1 parent 4bfb42a commit 1bfeb65

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

vite.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,19 @@ const pages = Object.fromEntries(
2323
])
2424
);
2525

26+
const manualChunks = (id) => {
27+
if (id.includes('node_modules')) {
28+
if (id.includes('apache-arrow')) {
29+
return 'apache-arrow';
30+
}
31+
if (id.includes('d3')) {
32+
return 'd3';
33+
}
34+
return 'vendor';
35+
}
36+
return undefined;
37+
};
38+
2639
export default defineConfig({
2740
base: './',
2841
plugins: [virtualHtmlTemplate({ pages })],
@@ -32,6 +45,7 @@ export default defineConfig({
3245
input: Object.fromEntries(
3346
chunks.map((chunk) => [chunk, `${chunk}.html`])
3447
),
48+
output: { manualChunks },
3549
},
3650
},
3751
resolve: {

0 commit comments

Comments
 (0)