Files
bun.sh/test/bundler/bundler_compile_splitting.test.ts
Jarred Sumner f0eb0472e6 Allow --splitting and --compile together (#23017)
### What does this PR do?

### How did you verify your code works?
2025-10-04 06:52:20 -07:00

41 lines
1.2 KiB
TypeScript

import { describe } from "bun:test";
import { itBundled } from "./expectBundled";
describe("bundler", () => {
describe("compile with splitting", () => {
itBundled("compile/splitting/RelativePathsAcrossChunks", {
compile: true,
splitting: true,
backend: "cli",
files: {
"/src/app/entry.ts": /* js */ `
console.log('app entry');
import('../components/header').then(m => m.render());
`,
"/src/components/header.ts": /* js */ `
export async function render() {
console.log('header rendering');
const nav = await import('./nav/menu');
nav.show();
}
`,
"/src/components/nav/menu.ts": /* js */ `
export async function show() {
console.log('menu showing');
const items = await import('./items');
console.log('items:', items.list);
}
`,
"/src/components/nav/items.ts": /* js */ `
export const list = ['home', 'about', 'contact'].join(',');
`,
},
entryPoints: ["/src/app/entry.ts"],
outdir: "/build",
run: {
stdout: "app entry\nheader rendering\nmenu showing\nitems: home,about,contact",
},
});
});
});