Skip to content

Commit

Permalink
feat: resolve cssPath with resolvePath (#465)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcrall authored May 20, 2022
1 parent 2a7416e commit 656eea5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
installModule,
addTemplate,
addServerMiddleware,
resolveAlias,
requireModule,
isNuxt2,
createResolver,
Expand Down Expand Up @@ -40,7 +39,7 @@ export default defineNuxtModule({
}),
async setup (moduleOptions, nuxt) {
const configPath = await resolvePath(moduleOptions.configPath)
const cssPath = moduleOptions.cssPath && resolveAlias(moduleOptions.cssPath)
const cssPath = await resolvePath(moduleOptions.cssPath, { extensions: ['.css', '.sass', '.scss', '.less', '.styl'] })
const injectPosition = ~~Math.min(moduleOptions.injectPosition, (nuxt.options.css || []).length + 1)

// Include CSS file in project css
Expand All @@ -49,6 +48,7 @@ export default defineNuxtModule({
logger.info(`Using Tailwind CSS from ~/${relative(nuxt.options.srcDir, cssPath)}`)
nuxt.options.css.splice(injectPosition, 0, cssPath)
} else {
logger.info('Using default Tailwind CSS file from runtime/tailwind.css')
const resolver = createResolver(import.meta.url)
nuxt.options.css.splice(injectPosition, 0, resolver.resolve('runtime/tailwind.css'))
}
Expand Down

0 comments on commit 656eea5

Please sign in to comment.