This repository was archived by the owner on Apr 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/nuxt/src/components Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import MagicString from 'magic-string'
7
7
import { pascalCase } from 'scule'
8
8
9
9
interface LoaderOptions {
10
- getComponents ( ) : Component [ ]
10
+ getComponents ( ) : Component [ ]
11
11
mode : 'server' | 'client'
12
12
sourcemap ?: boolean
13
13
transform ?: ComponentsOptions [ 'transform' ]
@@ -76,11 +76,11 @@ export const loaderPlugin = createUnplugin((options: LoaderOptions) => {
76
76
}
77
77
if ( lazy ) {
78
78
imports . add ( genImport ( 'vue' , [ { name : 'defineAsyncComponent' , as : '__defineAsyncComponent' } ] ) )
79
- imports . add ( `const ${ identifier } _lazy = __defineAsyncComponent(${ genDynamicImport ( component . filePath ) } )` )
80
- return isClientOnly ? `createClientOnly(${ identifier } _lazy)` : `${ identifier } _lazy`
79
+ imports . add ( `const ${ identifier } _lazy = /*#__PURE__*/ __defineAsyncComponent(${ genDynamicImport ( component . filePath ) } )` )
80
+ return isClientOnly ? `/*#__PURE__*/ createClientOnly(${ identifier } _lazy)` : `${ identifier } _lazy`
81
81
} else {
82
82
imports . add ( genImport ( component . filePath , [ { name : component . export , as : identifier } ] ) )
83
- return isClientOnly ? `createClientOnly(${ identifier } )` : identifier
83
+ return isClientOnly ? `/*#__PURE__*/ createClientOnly(${ identifier } )` : identifier
84
84
}
85
85
}
86
86
// no matched
You can’t perform that action at this time.
0 commit comments