vue-cli.30中
module.exports = {
// 默認情況下,Vue CLI 會假設你的應用是被部署在一個域名的根路徑上,例如 https://www.my-app.com/。
// 如果應用被部署在一個子路徑上,你就需要用這個選項指定這個子路徑。例如,如果你的應用被部署在 https://www.my-app.com/my-app/,
// 則設置 publicPath 爲 /my-app/ 這個值也可以被設置爲空字符串 ('') 或是相對路徑 ('./'),
// 這樣所有的資源都會被鏈接爲相對路徑,這樣打出來的包可以被部署在任意路徑,也可以用在類似 Cordova hybrid 應用的文件系統中。
publicPath: '/', // ./改爲/
// 當運行 vue-cli-service build 時生成的生產環境構建文件的目錄。注意目標目錄在構建之前會被清除 (構建時傳入 --no-clean 可關閉該行爲)。
outputDir: 'dist',
// 放置生成的靜態資源 (js、css、img、fonts) 的 (相對於 outputDir 的) 目錄
assetsDir: 'static',
// lintOnSave: process.env.NODE_ENV === 'development',
lintOnSave: false,//關閉eslint檢查
vue-cli2.x中
module.exports = {
dev: {
// Paths
assetsSubDirectory: 'static',
assetsPublicPath: '/', // ./改爲/
proxyTable: {
"/api": {
target: "http://172.30.248.74:",
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
},
//