UAW/vue.config.js
yuyongdong a44228e09c init
2024-04-10 11:10:07 +08:00

69 lines
1.8 KiB
JavaScript

const { defineConfig } = require('@vue/cli-service')
const CopyWebpackPlugin = require("copy-webpack-plugin");
function resolve(dir) {
return path.join(__dirname, dir)
}
module.exports = defineConfig({
transpileDependencies: true,
// configureWebpack: config => {
// const plugins = [
// new CopyWebpackPlugin(
// {
// patterns: [
// {
// from: __dirname + '/src/assets',
// to: "assets"
// },
// // {
// // from: __dirname + '/src/assets/horse_avatar',
// // to: "assets/horse_avatar"
// // },
// // {
// // from: __dirname + '/src/assets/parts',
// // to: "assets/parts"
// // },
// // {
// // from: __dirname + '/src/assets/partsTwo',
// // to: "assets/partsTwo"
// // },
// // {
// // from: __dirname + '/src/assets/skills',
// // to: "assets/skills"
// // },
// // {
// // from: __dirname + '/src/assets/fusion',
// // to: "assets/fusion"
// // }
// ]
// }
// ),
// //...其他的插件
// ];
// return { plugins }
// },
lintOnSave: false,
// productionSourceMap: false,
publicPath: '/',
devServer: {
open: false,
// host: '0.0.0.0', // 允许外部ip访问
port: 8030, // 端口
https: false, // 启用https
// overlay: {
// warnings: true,
// errors: true
// }, // 错误、警告在页面弹出
proxy: {
'/api': {
target: process.env.VUE_APP_API_URL,
changeOrigin: true, // 允许websockets跨域
pathRewrite: {
'^/api': ''
}
},
}, // 代理转发配置,用于调试环境
},
})