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
3 changes: 3 additions & 0 deletions src/commands/prepare.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { NuxtConfig } from '@nuxt/schema'
import { defineCommand } from 'citty'
import { resolve } from 'pathe'
import { readPackageJSON } from 'pkg-types'

export default defineCommand({
meta: {
Expand All @@ -20,11 +21,13 @@ export default defineCommand({
},
async run(context) {
const { runCommand } = await import('@nuxt/cli')
const moduleName = await readPackageJSON(context.args.rootDir, { try: true }).then(r => r.name)

const cwd = resolve(context.args.cwd || context.args.rootDir || '.')

return runCommand('prepare', [cwd], {
overrides: {
alias: moduleName ? { [moduleName]: resolve(cwd, './src/module') } : {},
compatibilityDate: '2024-04-03',
typescript: {
builder: 'shared',
Expand Down