Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit cb0de6f

Browse files
committed
fix: check custom tailwind path exist or not
1 parent 2b53ef6 commit cb0de6f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/karbon/src/cli/bundle/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import tsconfigPaths from 'vite-tsconfig-paths'
99
import { basename, join } from 'pathe'
1010
import Components from 'unplugin-vue-components/vite'
1111
import virtual from '@rollup/plugin-virtual'
12+
import fs from 'fs-extra'
1213
import consola from 'consola'
1314
import { loadNuxtConfig } from '@nuxt/kit'
1415
import { once } from 'remeda'
@@ -73,7 +74,8 @@ export async function bundle(path: string, vuefileName: string, layoutName: stri
7374
const rollupOptions = createConfig(name, dir, ssr)
7475
const config = await loadNuxtConfigOnce()
7576

76-
const tailwindConfigPath = `${process.cwd()}/tailwind.config.js`
77+
const _tailwindConfigPath = `${process.cwd()}/tailwind.config.js`
78+
const tailwindConfigPath = (await fs.pathExists(_tailwindConfigPath)) ? _tailwindConfigPath : undefined
7779

7880
await viteBuild({
7981
clearScreen: false,
@@ -110,7 +112,9 @@ export async function bundle(path: string, vuefileName: string, layoutName: stri
110112
},
111113
},
112114
],
113-
config: tailwindConfigPath,
115+
config: tailwindConfigPath ?? {
116+
content: [],
117+
},
114118
}),
115119
],
116120
},

0 commit comments

Comments
 (0)