Skip to content

Commit

Permalink
fix(vite): allow ts config file to be missing
Browse files Browse the repository at this point in the history
  • Loading branch information
harlan-zw committed Aug 24, 2022
1 parent fc4c6ac commit 3d9b6ad
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vite/src/plugins/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ export const AliasRuntimePlugin = () => createUnplugin<AliasPluginOptions>((user

// update types for whichever provider we're using
if (!updatedTSConfig && userConfig.dts && ctx.root && process.env.NODE_ENV !== 'production') {
const tsConfigFile = await resolveTSConfig(ctx.root)
let tsConfigFile: false | string = false
try {
tsConfigFile = await resolveTSConfig(ctx.root)
}
// it's fine if it fails
catch {}
if (tsConfigFile) {
const tsconfig = await readTSConfig(tsConfigFile)
tsconfig.compilerOptions = tsconfig.compilerOptions || {}
Expand Down

0 comments on commit 3d9b6ad

Please sign in to comment.