From 65ab0280e1a19d89cafc1d984762c2ab23096cc7 Mon Sep 17 00:00:00 2001 From: JaCraig Date: Wed, 23 Oct 2024 11:39:31 -0400 Subject: [PATCH] fix(typescript): fix path validation issue in validatePaths function --- packages/typescript/src/options/validate.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/typescript/src/options/validate.ts b/packages/typescript/src/options/validate.ts index c772ac0c1..5cb6a4c38 100644 --- a/packages/typescript/src/options/validate.ts +++ b/packages/typescript/src/options/validate.ts @@ -65,6 +65,11 @@ export function validatePaths( `@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside Rollup 'dir' option.` ); } + } else if(dirProperty === 'outDir') { + const fromTsDirToRollup = relative(compilerOptions[dirProperty],outputDir); + if (fromTsDirToRollup.startsWith('..')) { + context.error(`@rollup/plugin-typescript: Path of Typescript compiler option '${dirProperty}' must be located inside the same directory as the Rollup 'file' option.`); + } } else { const fromTsDirToRollup = relative(outputDir, compilerOptions[dirProperty]!); if (fromTsDirToRollup.startsWith('..')) {