【vue】vue.config.js
生活随笔
收集整理的這篇文章主要介紹了
【vue】vue.config.js
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
const goods = require('./data/goods.json'); const ratings = require('./data/ratings.json'); const seller = require('./data/seller.json');
module.exports = { publicPath: './', //輸出的根路徑 默認是/ 如果你的網(wǎng)站是app.com/vue 這更改此配置項 outputDir: 'dist',//構(gòu)建輸出目錄 assetsDir: 'assets',//靜態(tài)資源目錄(js,css,img,fonts) lintOnSave: false,//是否開啟eslint保存檢測,有效值:ture||false||'error'
devServer: { open: true, //開啟瀏覽器 host: 'localhost', port: 8081, https: false, hotOnly: false, proxy: {//配置跨域 '/api': { target: "http//localhost:5000/api/", ws: true,//是否跨域 changOrigin: true,//配置跨域 pathRewrite: {//重定向 '^/api': '' } } }, before(app) {// http://localhost:8081/api/goods app.get('/api/goods',(req,res) => { res.json(goods); }) app.get('/api/ratings',(req,res) => { res.json(ratings); }) app.get('/api/seller',(req,res) => { res.json(seller); }) } } }
module.exports = { publicPath: './', //輸出的根路徑 默認是/ 如果你的網(wǎng)站是app.com/vue 這更改此配置項 outputDir: 'dist',//構(gòu)建輸出目錄 assetsDir: 'assets',//靜態(tài)資源目錄(js,css,img,fonts) lintOnSave: false,//是否開啟eslint保存檢測,有效值:ture||false||'error'
devServer: { open: true, //開啟瀏覽器 host: 'localhost', port: 8081, https: false, hotOnly: false, proxy: {//配置跨域 '/api': { target: "http//localhost:5000/api/", ws: true,//是否跨域 changOrigin: true,//配置跨域 pathRewrite: {//重定向 '^/api': '' } } }, before(app) {// http://localhost:8081/api/goods app.get('/api/goods',(req,res) => { res.json(goods); }) app.get('/api/ratings',(req,res) => { res.json(ratings); }) app.get('/api/seller',(req,res) => { res.json(seller); }) } } }
轉(zhuǎn)載于:https://www.cnblogs.com/kevinmajesty/p/10648062.html
總結(jié)
以上是生活随笔為你收集整理的【vue】vue.config.js的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 多线程概念
- 下一篇: 初识Anrdiod SDK