Skip to content

Commit

Permalink
fix: check custom tailwind path exist or not
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSnow committed Jan 17, 2024
1 parent 2b53ef6 commit cb0de6f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/karbon/src/cli/bundle/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import tsconfigPaths from 'vite-tsconfig-paths'
import { basename, join } from 'pathe'
import Components from 'unplugin-vue-components/vite'
import virtual from '@rollup/plugin-virtual'
import fs from 'fs-extra'
import consola from 'consola'
import { loadNuxtConfig } from '@nuxt/kit'
import { once } from 'remeda'
Expand Down Expand Up @@ -73,7 +74,8 @@ export async function bundle(path: string, vuefileName: string, layoutName: stri
const rollupOptions = createConfig(name, dir, ssr)
const config = await loadNuxtConfigOnce()

const tailwindConfigPath = `${process.cwd()}/tailwind.config.js`
const _tailwindConfigPath = `${process.cwd()}/tailwind.config.js`
const tailwindConfigPath = (await fs.pathExists(_tailwindConfigPath)) ? _tailwindConfigPath : undefined

await viteBuild({
clearScreen: false,
Expand Down Expand Up @@ -110,7 +112,9 @@ export async function bundle(path: string, vuefileName: string, layoutName: stri
},
},
],
config: tailwindConfigPath,
config: tailwindConfigPath ?? {
content: [],
},
}),
],
},
Expand Down

0 comments on commit cb0de6f

Please sign in to comment.