Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,17 @@ export default defineNuxtModule<ModuleOptions>({
const { version, name } = await readPackageJSON(await resolvePath('../package.json'))
nuxt.options.alias['#nuxt-scripts-validator'] = await resolvePath(`./runtime/validation/${(nuxt.options.dev || nuxt.options._prepare) ? 'valibot' : 'mock'}`)
nuxt.options.alias['#nuxt-scripts'] = await resolvePath('./runtime')

// Ensure TypeScript path mapping for Nuxt 4 compatibility
nuxt.hooks.hook('prepare:types', async (options) => {
// Ensure paths are configured in TypeScript
if (options.tsConfig?.compilerOptions?.paths) {
options.tsConfig.compilerOptions.paths['#nuxt-scripts/*'] = [
await resolvePath('./runtime/*'),
]
}
})
Comment on lines +113 to +120
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's only for Nuxt 4, this cold be wrapped with isNuxtMajorVersion ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ye this is just what Claude code spat out it may be completely off, I'd ignore all the draft prs while I go through them


logger.level = (config.debug || nuxt.options.debug) ? 4 : 3
if (!config.enabled) {
// TODO fallback to useHead?
Expand Down
Loading