Skip to content

Commit b7c93ac

Browse files
authored
Fix: Adjust stub file paths for accurate resolution during rolldown build (#2217)
1 parent 1f6b5c9 commit b7c93ac

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

scripts/rolldown.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -323,16 +323,22 @@ export function createConfigsForPackage({
323323
if (rawFile == null) {
324324
return
325325
}
326-
const stub = stubs[rawFile]
326+
const filename = path.basename(rawFile)
327+
const stub = stubs[`dist/${filename}`]
327328
if (!stub) {
328329
return
329330
}
330331

331-
const filename = path.basename(rawFile)
332332
const contents = `export * from './${filename}'`
333333

334-
await fs.writeFile(stub, contents)
335-
// console.log(`created stub ${pc.bold(path.join('packages', target, 'dist', path.basename(stub)))}`)
334+
const fullpath = path.join(
335+
'packages',
336+
target,
337+
'dist',
338+
path.basename(stub)
339+
)
340+
await fs.writeFile(fullpath, contents)
341+
console.log(`created stub ${pc.bold(fullpath)}`)
336342
}
337343
}
338344
],

0 commit comments

Comments
 (0)