File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import * as AllComponents from 'element-plus'
22import * as AllIcons from '@element-plus/icons-vue'
33import type { ElIdInjectionContext , ElZIndexInjectionContext } from 'element-plus'
44import type { Component } from 'vue'
5- import { getComponentPath } from './core/components'
65import { isVueComponent } from './utils'
76import type { ModuleOptions , PresetDirectives , PresetImport } from './types'
87
@@ -29,11 +28,7 @@ export const allImportsWithStyle: string[] = [
2928 'ElNotification'
3029]
3130
32- const allImports : PresetImport [ ] = [
33- ...allImportsWithStyle . map ( ( name ) => {
34- return [ name , getComponentPath ( name ) ] as PresetImport
35- } )
36- ]
31+ const allImports : PresetImport [ ] = [ ]
3732
3833const allBaseImports : PresetImport [ ] = [
3934 [ 'ID_INJECTION_KEY' , 'es/hooks/use-id/index.mjs' ] ,
Original file line number Diff line number Diff line change 11import { addImportsSources } from '@nuxt/kit'
2- import { iconLibraryName , libraryName } from '../config'
2+ import { allImportsWithStyle , iconLibraryName , libraryName } from '../config'
33import { genIconPresets , resolvePath , toArray } from '../utils'
44import type { ModuleOptions , PresetImport } from '../types'
5+ import { getComponentPath } from './index'
56
67function _resolveImports ( imports : Set < PresetImport > ) {
78 imports . forEach ( async ( [ name , path ] ) => {
@@ -15,7 +16,10 @@ function _resolveImports (imports: Set<PresetImport>) {
1516export async function resolveImports ( config : ModuleOptions ) {
1617 const { imports, icon } = config
1718 const icons = icon !== false ? genIconPresets ( icon ) : [ ]
18- const allImports = new Set ( imports )
19+ const importsWithStyle = allImportsWithStyle . map ( ( name ) => {
20+ return [ name , getComponentPath ( name ) ] as PresetImport
21+ } )
22+ const allImports = new Set ( [ ...imports , ...importsWithStyle ] )
1923 const allIcons = new Set ( icons )
2024
2125 _resolveImports ( allImports )
You can’t perform that action at this time.
0 commit comments