@@ -44,26 +44,28 @@ export function validatePaths(
44
44
) {
45
45
if ( compilerOptions . out ) {
46
46
context . error (
47
- `@rollup/plugin-typescript: Deprecated 'out' option is not supported. Use 'outDir' instead.`
47
+ `@rollup/plugin-typescript: Deprecated Typescript compiler option 'out' is not supported. Use 'outDir' instead.`
48
48
) ;
49
49
} else if ( compilerOptions . outFile ) {
50
50
context . error (
51
- `@rollup/plugin-typescript: 'outFile' option is not supported. Use 'outDir' instead.`
51
+ `@rollup/plugin-typescript: Typescript compiler option 'outFile' is not supported. Use 'outDir' instead.`
52
52
) ;
53
53
}
54
54
55
55
for ( const dirProperty of DIRECTORY_PROPS ) {
56
56
if ( compilerOptions [ dirProperty ] ) {
57
57
if ( ! outputOptions . dir ) {
58
58
context . error (
59
- `@rollup/plugin-typescript: 'dir' must be used when '${ dirProperty } ' is specified.`
59
+ `@rollup/plugin-typescript: Rollup 'dir' option must be used when Typescript compiler option '${ dirProperty } ' is specified.`
60
60
) ;
61
61
}
62
62
63
63
// Checks if the given path lies within Rollup output dir
64
64
const fromRollupDirToTs = relative ( outputOptions . dir , compilerOptions [ dirProperty ] ! ) ;
65
65
if ( fromRollupDirToTs . startsWith ( '..' ) ) {
66
- context . error ( `@rollup/plugin-typescript: '${ dirProperty } ' must be located inside 'dir'.` ) ;
66
+ context . error (
67
+ `@rollup/plugin-typescript: Path of Typescript compiler option '${ dirProperty } ' must be located inside Rollup 'dir' option.`
68
+ ) ;
67
69
}
68
70
}
69
71
}
@@ -72,21 +74,24 @@ export function validatePaths(
72
74
if ( tsBuildInfoPath && compilerOptions . incremental ) {
73
75
if ( ! outputOptions . dir ) {
74
76
context . error (
75
- `@rollup/plugin-typescript: 'dir' must be used when 'tsBuildInfoFile' or 'incremental' are specified.`
77
+ `@rollup/plugin-typescript: Rollup 'dir' option must be used when Typescript compiler options 'tsBuildInfoFile' or 'incremental' are specified.`
76
78
) ;
77
79
}
78
80
79
81
// Checks if the given path lies within Rollup output dir
80
82
const fromRollupDirToTs = relative ( outputOptions . dir , tsBuildInfoPath ) ;
81
83
if ( fromRollupDirToTs . startsWith ( '..' ) ) {
82
- context . error ( `@rollup/plugin-typescript: 'tsBuildInfoFile' must be located inside 'dir'.` ) ;
84
+ context . error (
85
+ `@rollup/plugin-typescript: Path of Typescript compiler option 'tsBuildInfoFile' must be located inside Rollup 'dir' option.`
86
+ ) ;
83
87
}
84
88
}
85
89
86
90
if ( compilerOptions . declaration || compilerOptions . declarationMap || compilerOptions . composite ) {
87
91
if ( DIRECTORY_PROPS . every ( ( dirProperty ) => ! compilerOptions [ dirProperty ] ) ) {
88
92
context . error (
89
- `@rollup/plugin-typescript: 'outDir' or 'declarationDir' must be specified to generate declaration files.`
93
+ `@rollup/plugin-typescript: You are using one of Typescript's compiler options 'declaration', 'declarationMap' or 'composite'. ` +
94
+ `In this case 'outDir' or 'declarationDir' must be specified to generate declaration files.`
90
95
) ;
91
96
}
92
97
}
0 commit comments