Skip to content

Commit

Permalink
fix(typescript): fix path validation issue in validatePaths function
Browse files Browse the repository at this point in the history
Current code allows paths that are below the 'file' option but not nested directories. For example if file option is set to "C:/examplelib/output" then "C:/examplelib" is fine while "C:/examplelib/output/decl" is not. The order change in this commit fixes this issue introduced in 12.1.1.
  • Loading branch information
JaCraig committed Oct 23, 2024
1 parent 2f943d5 commit 62f7d81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/typescript/src/options/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.`
Expand Down

0 comments on commit 62f7d81

Please sign in to comment.