vue项目引入社区的ant-design-vue,根据其文档进行按需加载,如下图所示:
main.js
import Vue from 'vue'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'
import Vuex from 'vuex'
import App from './App'
import store from './store/index'
import router from './router'
import './utils/commonFunction/iconfont/iconfont.js'
import './utils/commonFunction/iconfont/iconfont.css'
import './assets/css/common.css'
import './assets/css/base.css'
import './assets/css/elementUiRe.css'
Vue.use(Antd)
Vue.use(Vuex)
Vue.config.productionTip = false
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
store,
components: { App },
template: '<App/>'
})
.babelrc
{
"presets": [
["env", {
"modules": false,
"targets": {
"browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
}
}],
"stage-2"
],
"plugins": [
"transform-vue-jsx",
["import", {
"libraryName": "ant-design-vue",
"libraryDirectory": "es",
"style": "css" }
],
"transform-runtime"
],
"env": {
"test": {
"presets": ["env"],
"plugins": [
"transform-vue-jsx",
"transform-es2015-modules-commonjs",
"dynamic-import-node",
"transform-runtime"
]
}
}
}
package.json
这里是我安装配置的地方,但是一旦启动项目,就报错
请问应该怎么修改处理?