我按照老师这个步骤,为啥报"TypeError: Cannot read property 'config' of undefined"
来源:11-2 入口文件迁移及 webpack 配置变更方式
lp1230
2020-10-09
写回答
2回答
-
田野落日
2021-04-12
应该是版本问题,可以这样
import {createApp} from 'vue';
import App from './App'
import router from './router'
import VueAwesomeSwiper from 'vue-awesome-swiper'
import store from './store'
import './assets/styles/reset.css'
import './assets/styles/border.css'
import './assets/styles/iconfont.css'
import 'swiper/dist/css/swiper.css'
// Vue.config.productionTip = false
// Vue.use(VueAwesomeSwiper)
createApp(App).use(router).mount('#app')
20 -
Samrtiboy
2020-10-10
同学你好,请您查看一下vue.config.js文件是否有误。
参考如下:
const path = require('path') module.exports = { devServer: { proxy: { '/api': { target: 'http://localhost:8080', pathRewrite: { '^/api': '/mock' } } } }, chainWebpack: (config) => { config.resolve.alias .set('styles', path.join(__dirname, './src/assets/styles/')) .set('@', path.join(__dirname, './src/')) .set('common', path.join(__dirname, './src/common/')) } }
022021-06-28
相似问题