Ai
2 Star 1 Fork 0

chenroaming/vue3-vantUI-typeScript

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vue.config.js 1.23 KB
一键复制 编辑 原始数据 按行查看 历史
const { defineConfig } = require('@vue/cli-service')
const { VantResolver } = require('unplugin-vue-components/resolvers')
const ComponentsPlugin = require('unplugin-vue-components/webpack')
const port = 80 // 端口
module.exports = defineConfig({
configureWebpack: {
plugins: [
ComponentsPlugin({
resolvers: [VantResolver()]
})
]
},
lintOnSave: process.env.NODE_ENV === 'development',
transpileDependencies: true,
productionSourceMap: process.env.NODE_ENV === 'development',
devServer: {
host: '0.0.0.0',
port: port,
open: true,
proxy: {
// 详情参阅: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// 这里以天天基金网的接口为示例
target: 'https://api.fund.eastmoney.com',
changeOrigin: true, // 是否跨域
pathRewrite: { // 重写路由路径
['^' + process.env.VUE_APP_BASE_API]: ''
},
headers: {
Host: 'api.fund.eastmoney.com',
Referer: 'https://fundf10.eastmoney.com/'
}
}
}
},
chainWebpack: config => {
// 引入ts文件时,不需要添加ts或者tsx后缀
config.resolve.extensions
.add('ts')
.add('tsx')
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/chenroaming/vue3-vant-ui-typescript.git
git@gitee.com:chenroaming/vue3-vant-ui-typescript.git
chenroaming
vue3-vant-ui-typescript
vue3-vantUI-typeScript
dev

搜索帮助