Skip to content

Commit

Permalink
Fix configFile: undefined in ts-loader options when not using a cus…
Browse files Browse the repository at this point in the history
…tom .storybook/tsconfig.json

Fixes #13381
  • Loading branch information
earshinov committed Dec 5, 2020
1 parent dbee613 commit dfde1a0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/angular/src/server/ts_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ function resolveTsConfig(tsConfigPath: string): string | undefined {
}

export default function (configDir: string) {
const configFilePath = resolveTsConfig(path.resolve(configDir, 'tsconfig.json'));
return {
const tsLoaderOptions = {
transpileOnly: true,
compilerOptions: {
emitDecoratorMetadata: true,
},
configFile: configFilePath || undefined,
};

const configFilePath = resolveTsConfig(path.resolve(configDir, 'tsconfig.json'));
if (configFilePath)
tsLoaderOptions.configFile = configFilePath;

return configFilePath;
}

0 comments on commit dfde1a0

Please sign in to comment.