diff --git a/packages/typescript/src/options/validate.ts b/packages/typescript/src/options/validate.ts index ae53834a3..c772ac0c1 100644 --- a/packages/typescript/src/options/validate.ts +++ b/packages/typescript/src/options/validate.ts @@ -66,7 +66,7 @@ export function validatePaths( ); } } else { - const fromTsDirToRollup = relative(compilerOptions[dirProperty]!, outputDir); + const fromTsDirToRollup = relative(outputDir, compilerOptions[dirProperty]!); 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.`