Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

Commit 0742e1a

Browse files
committed
fix: properly handle declarationDir
1 parent 6ed3266 commit 0742e1a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/instance.ts

+8-3
Original file line numberDiff line numberDiff line change
@@ -232,13 +232,18 @@ function applyDefaults(
232232
loaderConfig: LoaderConfig,
233233
context: string
234234
) {
235-
_.defaults(compilerConfig.options, {
235+
const def: any = {
236236
sourceMap: true,
237237
verbose: false,
238-
declarationDir: compilerConfig.options.outDir,
239238
skipDefaultLibCheck: true,
240239
suppressOutputPathCheck: true
241-
});
240+
};
241+
242+
if (compilerConfig.options.outDir && compilerConfig.options.declaration) {
243+
def.declarationDir = compilerConfig.options.outDir;
244+
}
245+
246+
_.defaults(compilerConfig.options, def);
242247

243248
if (loaderConfig.transpileOnly) {
244249
compilerConfig.options.isolatedModules = true;

0 commit comments

Comments
 (0)