Skip to content

Commit

Permalink
chore: add module types to build environment (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Dec 21, 2023
1 parent 41ac6e8 commit d06a063
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .nuxtrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
imports.autoImport=false
typescript.includeWorkspace=true
modules[]=nuxt-og-image
modules[]=@nuxtjs/tailwindcss
modules[]=@unocss/nuxt
site.url=https://nuxtseo.com
6 changes: 3 additions & 3 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ export default defineNuxtModule<ModuleOptions>({

const { resolve } = createResolver(import.meta.url)

nuxt.options.build.transpile.push(resolve('./runtime'))

const preset = resolveNitroPreset(nuxt.options.nitro)
const targetCompatibility = getPresetNitroPresetCompatibility(preset)

Expand Down Expand Up @@ -401,10 +403,8 @@ export default defineNuxtModule<ModuleOptions>({
// support simple theme extends
let unoCssConfig: any = { theme: {} }
nuxt.hook('tailwindcss:config', (tailwindConfig) => {
// @ts-expect-error untyped
unoCssConfig = defu(tailwindConfig.theme.extend, { ...(tailwindConfig.theme || {}), extend: undefined })
unoCssConfig = defu(tailwindConfig.theme?.extend, { ...tailwindConfig.theme, extend: undefined })
})
// @ts-expect-error runtime type
nuxt.hook('unocss:config', (_unoCssConfig) => {
unoCssConfig = { ..._unoCssConfig.theme }
})
Expand Down

0 comments on commit d06a063

Please sign in to comment.