Skip to content

Commit

Permalink
fix(macros): ignore macros imports
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Aug 3, 2023
1 parent 9867173 commit 93d2aa1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/neat-donuts-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'unplugin-vue-macros': patch
---

ignore macros imports
2 changes: 2 additions & 0 deletions packages/macros/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import VueSetupSFC, {
import VueShortEmits, {
type Options as OptionsShortEmits,
} from '@vue-macros/short-emits'
import { excludeDepOptimize } from './plugin'

export interface FeatureOptionsMap {
betterDefine: OptionsBetterDefine
Expand Down Expand Up @@ -316,6 +317,7 @@ export default createCombinePlugin<Options | undefined>(
framework === 'vite'
? Devtools({ nuxtContext: options.nuxtContext })
: undefined,
framework === 'vite' ? excludeDepOptimize() : undefined,
].filter(Boolean)

return {
Expand Down
14 changes: 14 additions & 0 deletions packages/macros/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { type Plugin } from 'vite'

export function excludeDepOptimize(): Plugin {
return {
name: 'vue-macros-exclude-dep-optimize',
config() {
return {
optimizeDeps: {
exclude: ['unplugin-vue-macros/macros'],
},
}
},
}
}

0 comments on commit 93d2aa1

Please sign in to comment.