Browse Source

feat: performance optimization.

pull/59/head
ruibaby 5 years ago
parent
commit
eb07f79f45
  1. 12
      babel.config.js
  2. 5
      src/core/lazy_use.js
  3. 2
      src/main.js

12
babel.config.js

@ -1,3 +1,10 @@
const plugins = []
plugins.push(['import', {
'libraryName': 'ant-design-vue',
'libraryDirectory': 'es',
'style': true // `style: true` 会加载 less 文件
}])
module.exports = {
presets: [
'@vue/app',
@ -7,5 +14,6 @@ module.exports = {
'useBuiltIns': 'entry'
}
]
]
}
],
plugins
}

5
src/core/lazy_use.js

@ -4,12 +4,9 @@ import config from '@/config/defaultSettings'
// base library
import '@/core/lazy_lib/components_use'
import 'ant-design-vue/dist/antd.less'
import bootstrap from './bootstrap'
// import 'ant-design-vue/dist/antd.less'
import VueClipboard from 'vue-clipboard2'
Vue.use(VueStorage, config.storageOptions)
Vue.use(VueClipboard)
bootstrap()

2
src/main.js

@ -5,6 +5,7 @@ import router from './router'
import store from './store/'
import './logger'
import bootstrap from './core/bootstrap'
import './core/lazy_use'
import './permission'
import '@/utils/filter' // global filter
@ -19,5 +20,6 @@ Vue.use(router)
new Vue({
router,
store,
created: bootstrap,
render: h => h(App)
}).$mount('#app')

Loading…
Cancel
Save