'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.
// 用于处理路径统一的问题
const path = require('path')
module.exports = {
// 开发环境的配置
dev: {
// Paths
assetsSubDirectory: 'static', // 静态资源文件夹
assetsPublicPath: '/', // 发布路径
// 一般解决跨域请求api
proxyTable: {
'/api': {
target: 'http://api.douban.com/v2', // 目标url
changeOrigin: true, // 是否跨域
pathRewrite: {
'^/api': '' // 可以使用 /api 等价于 http://api.douban.com/v2
}
}
},
// Various Dev Server settings
host: 'localhost', // can be overwritten by process.env.HOST
port: 8080, // dev-server的端口号,可以自行更改
autoOpenBrowser: false, // 是否自定代开浏览器
errorOverlay: true, // 查询错误
vue 的config 目录下index.js详解
最新推荐文章于 2024-04-21 23:59:49 发布
本文详细探讨了Vue.js项目中config目录下的index.js配置文件,包括它的作用、常用配置选项及其影响,帮助开发者更好地理解和定制Vue应用的构建过程。
摘要由CSDN通过智能技术生成