From f3439fb7c3370d25c6e026322a1999fe2e0f92eb Mon Sep 17 00:00:00 2001 From: everdimension Date: Sat, 24 Oct 2020 14:23:26 +0300 Subject: [PATCH] Better error messages I saw the original `'dir' must be used when 'outDir' is specified` error and spent a lot of time figuring it out because ts compiler doesn't have this 'dir' option (https://www.typescriptlang.org/docs/handbook/compiler-options.html), but the error sounds as if it should I changed the message a bit to avoid this confusion. --- packages/typescript/src/options/validate.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/typescript/src/options/validate.ts b/packages/typescript/src/options/validate.ts index dce893d47..a5fb64af9 100644 --- a/packages/typescript/src/options/validate.ts +++ b/packages/typescript/src/options/validate.ts @@ -56,7 +56,7 @@ export function validatePaths( if (compilerOptions[dirProperty]) { if (!outputOptions.dir) { context.error( - `@rollup/plugin-typescript: 'dir' must be used when '${dirProperty}' is specified.` + `@rollup/plugin-typescript: 'output.dir' must be used in rollup config when '${dirProperty}' is specified in tsconfig.` ); } @@ -72,7 +72,7 @@ export function validatePaths( if (tsBuildInfoPath && compilerOptions.incremental) { if (!outputOptions.dir) { context.error( - `@rollup/plugin-typescript: 'dir' must be used when 'tsBuildInfoFile' or 'incremental' are specified.` + `@rollup/plugin-typescript: 'output.dir' must be used in rollup config when 'tsBuildInfoFile' or 'incremental' are specified in tsconfig.` ); }