This repository was archived by the owner on Apr 6, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
packages/nuxt/src/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import MagicString from 'magic-string'
77import { pascalCase } from 'scule'
88
99interface LoaderOptions {
10- getComponents ( ) : Component [ ]
10+ getComponents ( ) : Component [ ]
1111 mode : 'server' | 'client'
1212 sourcemap ?: boolean
1313 transform ?: ComponentsOptions [ 'transform' ]
@@ -76,11 +76,11 @@ export const loaderPlugin = createUnplugin((options: LoaderOptions) => {
7676 }
7777 if ( lazy ) {
7878 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`
8181 } else {
8282 imports . add ( genImport ( component . filePath , [ { name : component . export , as : identifier } ] ) )
83- return isClientOnly ? `createClientOnly(${ identifier } )` : identifier
83+ return isClientOnly ? `/*#__PURE__*/ createClientOnly(${ identifier } )` : identifier
8484 }
8585 }
8686 // no matched
You can’t perform that action at this time.
0 commit comments