feat: add tsConfigPath option
This commit is contained in:
parent
c20746a2b4
commit
f1a7097464
|
|
@ -9,6 +9,7 @@ import { resolveImport } from '@/src/utils/resolve-import'
|
|||
export const DEFAULT_STYLE = 'default'
|
||||
export const DEFAULT_COMPONENTS = '@/components'
|
||||
export const DEFAULT_UTILS = '@/lib/utils'
|
||||
export const DEFAULT_TYPESCRIPT_CONFIG = './tsconfig.json'
|
||||
export const DEFAULT_TAILWIND_CONFIG = 'tailwind.config.js'
|
||||
export const DEFAULT_TAILWIND_BASE_COLOR = 'slate'
|
||||
|
||||
|
|
@ -32,9 +33,7 @@ export const rawConfigSchema = z
|
|||
prefix: z.string().optional(),
|
||||
}),
|
||||
framework: z.string().default('Vite'),
|
||||
nuxt: z.object({
|
||||
buildDir: z.string().default('.nuxt'),
|
||||
}).optional(),
|
||||
tsConfigPath: z.string().default('./tsconfig.json'),
|
||||
aliases: z.object({
|
||||
components: z.string(),
|
||||
utils: z.string(),
|
||||
|
|
@ -71,7 +70,7 @@ export async function resolveConfigPaths(cwd: string, config: RawConfig) {
|
|||
let tsConfig: ConfigLoaderResult | undefined
|
||||
let tsConfigPath = path.resolve(
|
||||
cwd,
|
||||
config.framework === 'nuxt' ? `${config.nuxt?.buildDir}/tsconfig.json` : './tsconfig.json',
|
||||
config.tsConfigPath,
|
||||
)
|
||||
|
||||
if (config.typescript) {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ it('get raw config', async () => {
|
|||
baseColor: 'neutral',
|
||||
cssVariables: false,
|
||||
},
|
||||
tsConfigPath: './tsconfig.json',
|
||||
aliases: {
|
||||
components: '@/components',
|
||||
utils: '@/lib/utils',
|
||||
|
|
@ -55,6 +56,7 @@ it('get config', async () => {
|
|||
utils: '@/lib/utils',
|
||||
},
|
||||
framework: 'Vite',
|
||||
tsConfigPath: './tsconfig.json',
|
||||
resolvedPaths: {
|
||||
tailwindConfig: path.resolve(
|
||||
__dirname,
|
||||
|
|
@ -102,6 +104,7 @@ it('get config', async () => {
|
|||
utils: '~/lib/utils',
|
||||
},
|
||||
framework: 'Vite',
|
||||
tsConfigPath: './tsconfig.json',
|
||||
resolvedPaths: {
|
||||
tailwindConfig: path.resolve(
|
||||
__dirname,
|
||||
|
|
@ -148,6 +151,7 @@ it('get config', async () => {
|
|||
utils: '@/lib/utils',
|
||||
},
|
||||
framework: 'Vite',
|
||||
tsConfigPath: './tsconfig.json',
|
||||
resolvedPaths: {
|
||||
tailwindConfig: path.resolve(
|
||||
__dirname,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user