Skip to content

Commit

Permalink
fix: accept absolute path in bundle entrypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyben committed Nov 25, 2019
1 parent 0edae8b commit ad19633
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/bundle-addon/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { collectDirectives } from './directive-collector'
import { SymbolCollector } from './symbol-collector'
import { DeclarationCollector } from './declaration-collector'
import { print } from './printer'
import { ensureAbsolutePath } from '../utils/path'

/**
* @internal
Expand Down Expand Up @@ -41,7 +42,10 @@ export function bundleDts(
const dtsOptions = dtsProgram.getCompilerOptions()

let entryPoints = typeof entryPoint === 'string' ? [entryPoint] : entryPoint
entryPoints = entryPoints.map((e) => join(dtsOutDir, e.replace(/(\.js|\.ts|\.d\.ts)$/m, '.d.ts')))
entryPoints = entryPoints.map((ep) => {
ep = ep.replace(/(\.js|\.ts|\.d\.ts)$/m, '.d.ts')
return ensureAbsolutePath(ep, dtsOutDir)
})

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

return [path, bundled] as const
})
Expand Down

0 comments on commit ad19633

Please sign in to comment.