@@ -54,7 +54,7 @@ const COMPONENT_ALIASES: Record<string, string> = {
54
54
*
55
55
* @link https://github.com/bootstrap-vue/bootstrap-vue
56
56
*/
57
- export function BootstrapVueResolver ( _options : BootstrapVueResolverOptions = { } ) : ComponentResolver [ ] {
57
+ export const BootstrapVueResolver = ( _options : BootstrapVueResolverOptions = { } ) : ComponentResolver [ ] => {
58
58
const options = { directives : true , ..._options }
59
59
const resolvers : ComponentResolver [ ] = [ {
60
60
type : 'component' ,
@@ -84,3 +84,60 @@ export function BootstrapVueResolver(_options: BootstrapVueResolverOptions = {})
84
84
85
85
return resolvers
86
86
}
87
+
88
+ /**
89
+ * Resolver for BootstrapVueNext
90
+ *
91
+ * @link https://github.com/bootstrap-vue/bootstrap-vue-next
92
+ */
93
+ export const BootstrapVueNextResolver = ( _options : BootstrapVueResolverOptions = { } ) : Array < ComponentResolver > => {
94
+ const options = { directives : true , ..._options }
95
+ const resolvers : Array < ComponentResolver > = [ {
96
+ type : 'component' ,
97
+ resolve : ( name ) => {
98
+ if ( name . match ( / ^ B [ A - Z ] / ) )
99
+ return { name, from : 'bootstrap-vue-next' }
100
+ } ,
101
+ } ]
102
+
103
+ if ( options . directives ) {
104
+ resolvers . push ( {
105
+ type : 'directive' ,
106
+ resolve : ( name ) => {
107
+ if ( name . match ( / ^ B [ A - Z ] / ) )
108
+ return { name : `v${ name } ` , from : 'bootstrap-vue-next' }
109
+ } ,
110
+ } )
111
+ }
112
+
113
+ return resolvers
114
+ }
115
+
116
+ /**
117
+ * Resolver for legacy BootstrapVue3 apps
118
+ *
119
+ * @deprecated use BootstrapVueNextResolver with https://github.com/bootstrap-vue/bootstrap-vue-next
120
+ * @link https://www.npmjs.com/package/bootstrap-vue-3
121
+ */
122
+ export const BootstrapVue3Resolver = ( _options : BootstrapVueResolverOptions = { } ) : Array < ComponentResolver > => {
123
+ const options = { directives : true , ..._options }
124
+ const resolvers : Array < ComponentResolver > = [ {
125
+ type : 'component' ,
126
+ resolve : ( name ) => {
127
+ if ( name . match ( / ^ B [ A - Z ] / ) )
128
+ return { name, from : 'bootstrap-vue-3' }
129
+ } ,
130
+ } ]
131
+
132
+ if ( options . directives ) {
133
+ resolvers . push ( {
134
+ type : 'directive' ,
135
+ resolve : ( name ) => {
136
+ if ( name . match ( / ^ B [ A - Z ] / ) )
137
+ return { name : `V${ name } ` , from : 'bootstrap-vue-3' }
138
+ } ,
139
+ } )
140
+ }
141
+
142
+ return resolvers
143
+ }
0 commit comments