bun icon indicating copy to clipboard operation
bun copied to clipboard

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

Open terrywh opened this issue 2 years ago • 2 comments
trafficstars

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

terrywh avatar Jul 12 '23 10:07 terrywh

what is the reason this is closed ?

I have the same problem :sweat_smile:

michaelchiche avatar Nov 11 '23 10:11 michaelchiche

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

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

bndkt avatar Apr 25 '24 03:04 bndkt