File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -198,7 +198,7 @@ export function useComponentMetaParser (
198
198
const startTime = performance . now ( )
199
199
await Promise . all ( Object . values ( components ) . map ( fetchComponent ) )
200
200
const endTime = performance . now ( )
201
- if ( ! debug ) { logger . success ( `Components metas parsed in ${ ( endTime - startTime ) . toFixed ( 2 ) } ms` ) }
201
+ if ( ! debug || debug === 2 ) { logger . success ( `Components metas parsed in ${ ( endTime - startTime ) . toFixed ( 2 ) } ms` ) }
202
202
}
203
203
204
204
return {
Original file line number Diff line number Diff line change @@ -7,15 +7,23 @@ type ComponentMetaUnpluginOptions = { parser?: ComponentMetaParser } & ModuleOpt
7
7
export const metaPlugin = createUnplugin < ComponentMetaUnpluginOptions > (
8
8
( { parser, ...options } ) => {
9
9
const instance = ( parser || useComponentMetaParser ( options ) ) as ComponentMetaParser
10
+ let _configResolved : any
10
11
11
12
return {
12
13
name : 'vite-plugin-nuxt-component-meta' ,
13
14
enforce : 'post' ,
14
15
async buildStart ( ) {
16
+ // avoid parsing meta twice in SSR
17
+ if ( _configResolved ?. build . ssr ) {
18
+ return
19
+ }
15
20
await instance . fetchComponents ( )
16
21
await instance . updateOutput ( )
17
22
} ,
18
23
vite : {
24
+ configResolved ( config ) {
25
+ _configResolved = config
26
+ } ,
19
27
async handleHotUpdate ( { file } ) {
20
28
if ( Object . entries ( instance . components ) . some ( ( [ , comp ] : any ) => comp . fullPath === file ) ) {
21
29
await instance . fetchComponent ( file )
You can’t perform that action at this time.
0 commit comments