Browse Source

feat: performance optimization.

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

10
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 = { module.exports = {
presets: [ presets: [
'@vue/app', '@vue/app',
@ -7,5 +14,6 @@ module.exports = {
'useBuiltIns': 'entry' 'useBuiltIns': 'entry'
} }
] ]
] ],
plugins
} }

5
src/core/lazy_use.js

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

2
src/main.js

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

Loading…
Cancel
Save