fix(cli): add an option to component.json to resolve nuxt buildDir dynamically
This commit is contained in:
parent
46f7ffb65a
commit
3e1fd9892c
|
|
@ -17,6 +17,7 @@
|
|||
"lint": "eslint .",
|
||||
"lint:fix": "eslint . --fix",
|
||||
"dev:cli": "pnpm --filter shadcn-vue dev",
|
||||
"dev:nuxt": "pnpm --filter shadcn-nuxt dev",
|
||||
"build:cli": "pnpm --filter shadcn-vue build",
|
||||
"build:registry": "pnpm --filter=www build:registry",
|
||||
"bumpp": "bumpp package.json packages/*/package.json apps/*/package.json",
|
||||
|
|
|
|||
|
|
@ -32,6 +32,9 @@ export const rawConfigSchema = z
|
|||
prefix: z.string().optional(),
|
||||
}),
|
||||
framework: z.string().default('Vite'),
|
||||
nuxt: z.object({
|
||||
buildDir: z.string().default('.nuxt'),
|
||||
}).optional(),
|
||||
aliases: z.object({
|
||||
components: z.string(),
|
||||
utils: z.string(),
|
||||
|
|
@ -68,7 +71,7 @@ export async function resolveConfigPaths(cwd: string, config: RawConfig) {
|
|||
let tsConfig: ConfigLoaderResult | undefined
|
||||
let tsConfigPath = path.resolve(
|
||||
cwd,
|
||||
config.framework === 'nuxt' ? '.nuxt/tsconfig.json' : './tsconfig.json',
|
||||
config.framework === 'nuxt' ? `${config.nuxt?.buildDir}/tsconfig.json` : './tsconfig.json',
|
||||
)
|
||||
|
||||
if (config.typescript) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user