Skip to content

Commit 04b84df

Browse files
authored
Don't call path.dirname with null/undefined (#202)
Node 6+ enforces the parameter to path.dirname to be a string (nodejs/node@08085c4). The empty string results in the previous behavior.
2 parents aff605e + a4f8353 commit 04b84df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,13 @@ function ensureTypeScriptInstance(loaderOptions: LoaderOptions, loader: any): {
250250
configParseResult = (<TSCompatibleCompiler><any>compiler).parseJsonConfigFileContent(
251251
configFile.config,
252252
compiler.sys,
253-
path.dirname(configFilePath)
253+
path.dirname(configFilePath || '')
254254
);
255255
} else {
256256
configParseResult = (<TSCompatibleCompiler><any>compiler).parseConfigFile(
257257
configFile.config,
258258
compiler.sys,
259-
path.dirname(configFilePath)
259+
path.dirname(configFilePath || '')
260260
);
261261
}
262262

0 commit comments

Comments
 (0)