Skip to content

Commit aa7980a

Browse files
author
Pooya Parsa
committed
[BREAKING CHANGE] Fix webpack require issues and more compatibility. import {} from 'bootstrap-vue' => 'bootstrap-vue/components'
1 parent 5158bc5 commit aa7980a

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

index.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import * as components from './components';
1+
import components from './components';
22

3-
function plugin(Vue) {
4-
if (plugin.installed) return;
5-
6-
Object.keys(components).forEach(function(key){
7-
Vue.component(key, components[key])
8-
});
9-
}
3+
const VuePlugin = {
4+
install(Vue){
5+
if (VuePlugin.installed) return;
6+
VuePlugin.installed = true;
7+
for (let key in components) {
8+
Vue.component(key, components[key])
9+
}
10+
}
11+
};
1012

1113
if (typeof window !== 'undefined' && window.Vue) {
12-
window.Vue.use(plugin);
14+
window.Vue.use(VuePlugin);
1315
}
1416

15-
export * from './components';
16-
export default plugin;
17+
module.exports = VuePlugin;

0 commit comments

Comments
 (0)