@@ -21,17 +21,11 @@ export interface ModuleOptions {
21
21
lowlight ?:
22
22
| boolean
23
23
| {
24
- /**
25
- * Determine if lowlight should be enabled
26
- *
27
- * @default false
28
- */
29
- enabled : boolean ;
30
24
/**
31
25
* Languages to be loaded for highlighting
32
26
*
33
27
*/
34
- languages : string [ ] ;
28
+ // languages: string[];
35
29
} ;
36
30
}
37
31
@@ -54,6 +48,9 @@ export default defineNuxtModule<ModuleOptions>({
54
48
55
49
const transpileModules = new Set < string > ( [ ] ) ;
56
50
51
+ var optionalImports : { [ key : string ] : any } [ ] = [ ] ;
52
+ var optionalComponents : { [ key : string ] : any } [ ] = [ ] ;
53
+
57
54
// Do not add the extension since the `.ts` will be transpiled to `.mjs` after `npm run prepack`
58
55
for ( const obj of allImports . defaultComposables ) {
59
56
addImports ( {
@@ -78,21 +75,21 @@ export default defineNuxtModule<ModuleOptions>({
78
75
for ( const obj of allImports . defaultComponents ) {
79
76
addComponent ( {
80
77
mode : "client" ,
81
- name : obj . name ,
78
+ name : ` ${ options . prefix } ${ obj . name } ` ,
82
79
export : obj . name ,
83
80
filePath : obj . path ,
84
81
// _internal_install: obj.path,
85
82
} ) ;
86
83
transpileModules . add ( obj . path ) ;
87
84
}
88
85
89
- if ( options . lowlight = == false ) {
90
- allImports . optionalImports . push ( ... allImports . lowlightImports ) ;
86
+ if ( ! ! options . lowlight && options . lowlight ! == false ) {
87
+ optionalImports = [ ... optionalImports , ... allImports . lowlightImports ] ;
91
88
}
92
89
93
- for ( const obj of allImports . optionalImports ) {
90
+ for ( const obj of optionalImports ) {
94
91
addImports ( {
95
- as : obj . name ,
92
+ as : ` ${ options . prefix } ${ obj . name } ` ,
96
93
name : obj . name ,
97
94
from : obj . path ,
98
95
// _internal_install: obj.path,
0 commit comments