Skip to content

Commit 54390e0

Browse files
fix(vite-plugin-angular): adjust output path for library dts files (#1728)
1 parent 5a564be commit 54390e0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/vite-plugin-angular/src/lib/angular-vite-plugin.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -983,16 +983,16 @@ export function angular(options?: PluginOptions): Plugin[] {
983983
/\.d\.ts/.test(filename) &&
984984
!filename.includes('.ngtypecheck.')
985985
) {
986+
// output to library root instead /src
986987
const declarationPath = resolve(
987988
config.root,
988989
config.build.outDir,
989990
relative(config.root, filename),
990-
);
991+
).replace('/src/', '/');
991992

992-
const declarationFileDir = declarationPath.replace(
993-
basename(filename),
994-
'',
995-
);
993+
const declarationFileDir = declarationPath
994+
.replace(basename(filename), '')
995+
.replace('/src/', '/');
996996

997997
declarationFiles.push({
998998
declarationFileDir,

0 commit comments

Comments
 (0)