Skip to content

Commit

Permalink
feat: set cssPath false to disable adding the CSS (#362)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricklin90085 committed Jun 22, 2021
1 parent 6bcf442 commit 695d068
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function tailwindCSSModule (moduleOptions) {
})

const configPath = nuxt.resolver.resolveAlias(options.configPath)
const cssPath = nuxt.resolver.resolveAlias(options.cssPath)
const cssPath = options.cssPath && nuxt.resolver.resolveAlias(options.cssPath)

// Extend postcss config
// https://tailwindcss.com/docs/using-with-preprocessors#future-css-features
Expand All @@ -37,11 +37,13 @@ async function tailwindCSSModule (moduleOptions) {

// Include CSS file in project css
/* istanbul ignore else */
if (existsSync(cssPath)) {
logger.info(`Using Tailwind CSS from ~/${relative(nuxt.options.srcDir, cssPath)}`)
nuxt.options.css.unshift(cssPath)
} else {
nuxt.options.css.unshift(resolve(__dirname, 'runtime', 'tailwind.css'))
if (typeof cssPath === 'string') {
if (existsSync(cssPath)) {
logger.info(`Using Tailwind CSS from ~/${relative(nuxt.options.srcDir, cssPath)}`)
nuxt.options.css.unshift(cssPath)
} else {
nuxt.options.css.unshift(resolve(__dirname, 'runtime', 'tailwind.css'))
}
}

// Get and extend the Tailwind config
Expand Down

0 comments on commit 695d068

Please sign in to comment.