main.js (878B)
1 import './assets/styles/app.css'; 2 3 import Vue from 'vue'; 4 import App from './App.vue'; 5 import upperFirst from 'lodash/upperFirst'; 6 import camelCase from 'lodash/camelCase'; 7 import VueSocialSharing from 'vue-social-sharing'; 8 import Toasted from 'vue-toasted'; 9 10 Vue.use(VueSocialSharing); 11 Vue.use(Toasted); 12 13 Vue.config.productionTip = false; 14 15 const requireComponent = require.context( 16 './components', 17 false, 18 /Base[A-Z]\w+\.(vue|js)$/ 19 ); 20 21 requireComponent.keys().forEach((fileName) => { 22 const componentConfig = requireComponent(fileName); 23 24 const componentName = upperFirst( 25 camelCase( 26 fileName 27 .split('/') 28 .pop() 29 .replace(/\.\w+$/, '') 30 ) 31 ); 32 33 Vue.component(componentName, componentConfig.default || componentConfig); 34 }); 35 36 new Vue({ 37 render: (h) => h(App), 38 }).$mount('#app');