Skip to content

Commit ad19633

Browse files
committed
fix: accept absolute path in bundle entrypoint
1 parent 0edae8b commit ad19633

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/bundle-addon/index.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { collectDirectives } from './directive-collector'
66
import { SymbolCollector } from './symbol-collector'
77
import { DeclarationCollector } from './declaration-collector'
88
import { print } from './printer'
9+
import { ensureAbsolutePath } from '../utils/path'
910

1011
/**
1112
* @internal
@@ -41,7 +42,10 @@ export function bundleDts(
4142
const dtsOptions = dtsProgram.getCompilerOptions()
4243

4344
let entryPoints = typeof entryPoint === 'string' ? [entryPoint] : entryPoint
44-
entryPoints = entryPoints.map((e) => join(dtsOutDir, e.replace(/(\.js|\.ts|\.d\.ts)$/m, '.d.ts')))
45+
entryPoints = entryPoints.map((ep) => {
46+
ep = ep.replace(/(\.js|\.ts|\.d\.ts)$/m, '.d.ts')
47+
return ensureAbsolutePath(ep, dtsOutDir)
48+
})
4549

4650
try {
4751
// Retrieve all bundles before writing them, to fail on error before any IO.
@@ -58,7 +62,6 @@ export function bundleDts(
5862
[directives.typeRef, directives.libRef, declarations.imports, declarations.exports],
5963
dtsOptions.newLine
6064
)
61-
// console.log(bundled)
6265

6366
return [path, bundled] as const
6467
})

0 commit comments

Comments
 (0)