Skip to content

Commit 4ff3253

Browse files
committed
Update module.ts
1 parent c11d503 commit 4ff3253

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/module.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,14 +284,15 @@ export default defineNuxtModule<ModuleOptions>({
284284
getContents: async () => {
285285
if (options.types) {
286286
try {
287+
// resolvePath is used to minify user input error.
287288
const path = await resolvePath(options.types)
288-
const typesPath = await resolvePath('~~/.nuxt/types/')
289+
const typesPath = await resolvePath('~~/.nuxt/types/') // this is the default path for nuxt types
289290

290291
if (fs.existsSync(path)) {
292+
// Make the path relative to the "types" directory.
291293
return `export * from '${relative(typesPath, path)}'`
292294
}
293295
else {
294-
// Add warning if configured but not found
295296
logger.warn(
296297
`Database types configured at "${options.types}" but file not found. `
297298
+ `Using "Database = unknown".`,

0 commit comments

Comments
 (0)