Skip to content

Commit

Permalink
fix: correct match result for alias form tsconfig
Browse files Browse the repository at this point in the history
fix #298
  • Loading branch information
qmhc committed Jan 24, 2024
1 parent b2884da commit 88469d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/plugin.ts
Expand Up @@ -288,9 +288,9 @@ export function dtsPlugin(options: PluginOptions = {}): import('vite').Plugin {
if (pathsToAliases && baseUrl && paths) {
const basePath = ensureAbsolute(baseUrl, configPath ? dirname(configPath) : root)

for (const [findWithAsterisk, replacements] of Object.entries(paths)) {
for (const [pathWithAsterisk, replacements] of Object.entries(paths)) {
const find = new RegExp(
findWithAsterisk.replace(regexpSymbolRE, '\\$1').replace(asteriskRE, '(.+)')
`^${pathWithAsterisk.replace(regexpSymbolRE, '\\$1').replace(asteriskRE, '(.+)')}$`
)

let index = 1
Expand Down

0 comments on commit 88469d0

Please sign in to comment.