oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.48k stars 2.71k forks source link

build with splitting enabled, wrong import path for chunk under root directory #3615

Open terrywh opened 1 year ago

terrywh commented 1 year ago

What version of Bun is running?

v0.6.13

What platform is your computer?

Darwin 22.5.0 arm64 arm

What steps can reproduce the bug?

// build.js await Bun.build({ root: "./www", entrypoints: ["./www/test1.js", "./www/test2.js"], outdir: "./public", sourcemap: "external", splitting: true, naming: "[dir]/[name].[ext]", target: "browser", }); // www/test1.js + www/test2.js import { writable } from "svelte/store"; export const store = writable(0);

What is the expected behavior?

output file should use "./chunk-xxxxxx.js" or "/chunk-xxxxxxx.js" to import

What do you see instead?

image

Additional information

Chrome:

image
michaelchiche commented 10 months ago

what is the reason this is closed ?

I have the same problem :sweat_smile:

bndkt commented 5 months ago

@terrywh this issue still persists, can we please reopen?

It seems to only occur when specifying [dir] as part of the "naming" option.