코딩/Vue.js

vue에서 정적 자원 호출 시 개발 서버 바라보게 하기

타다키치 2018. 7. 23. 13:18

dev에서는 image 등 정적 자원을 /static으로, proc에서는 /assets 으로 바라볼 때 dev가 개발 서버를 바라보도록 하려면


다음과 같이 config/index.js에서 

// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {
'/assets': {
target: 'http://localhost:9000',
changeOrigin: true
}
},

와 같이 proxyTable을 설정해준다.