Skip to content

Commit

Permalink
fix(nuxt): exclude macro virtual fils
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Feb 28, 2023
1 parent 217998a commit a326d95
Show file tree
Hide file tree
Showing 4 changed files with 975 additions and 22 deletions.
1 change: 1 addition & 0 deletions interactive/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default defineNuxtConfig({
alias,
modules: [
'@vueuse/nuxt',
'@nuxt/devtools',
'~/../packages/nuxt/src/index.ts',
'~/modules/markdown',
],
Expand Down
1 change: 1 addition & 0 deletions interactive/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"devDependencies": {
"@antfu/utils": "^0.7.2",
"@nuxt/devtools": "^0.2.5",
"@unocss/autocomplete": "workspace:*",
"@unocss/nuxt": "workspace:*",
"@unocss/shared-docs": "workspace:*",
Expand Down
5 changes: 5 additions & 0 deletions packages/nuxt/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import presetWebFonts from '@unocss/preset-web-fonts'
import presetTypography from '@unocss/preset-typography'
import presetTagify from '@unocss/preset-tagify'
import presetWind from '@unocss/preset-wind'
import { defaultExclude } from '../../shared-integration/src/defaults'
import type { UnocssNuxtOptions } from './types'

export function resolveOptions(options: UnocssNuxtOptions) {
Expand All @@ -25,4 +26,8 @@ export function resolveOptions(options: UnocssNuxtOptions) {
options.presets.push(preset(typeof option === 'boolean' ? {} : option))
}
}
options.exclude = options.exclude || defaultExclude
// ignore macro files created by Nuxt
if (Array.isArray(options.exclude))
options.exclude.push(/\?macro=true/)
}
Loading

0 comments on commit a326d95

Please sign in to comment.