You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

68 lines
1.8 KiB

/*
* @Author: your name
* @Date: 2020-12-03 09:37:13
* @LastEditTime: 2020-12-04 18:17:46
* @LastEditors: your name
* @Description: In User Settings Edit
* @FilePath: \yxj-web\vue.config.js
*/
const path = require("path");
module.exports = {
lintOnSave: false,
outputDir: process.env.NODE_ENV === "development" ? "dist-dev" : process.env.NODE_ENV === "test" ? "dist-test" : "website_h",
publicPath: "./",
configureWebpack: {
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
style: path.resolve(__dirname, "src/styles"),
},
},
},
// css: {
// loaderOptions: {
// sass: {
// additionalData: `
// @import "~@/assets/styles/_variable.scss";
// `,
// },
// },
// },
chainWebpack: (config) => {
config.module.rules.delete("svg"); //重点:删除默认配置中处理svg,
config.module
.rule("svg-sprite-loader")
.test(/\.svg$/)
.include.add(path.resolve("src/assets/svg/components")) //处理svg目录
.end()
.use("svg-sprite-loader")
.loader("svg-sprite-loader")
.options({
symbolId: "icon-[name]",
});
},
devServer: {
// 环境配置
host: "0.0.0.0",
port: 8082,
https: false,
hotOnly: false,
open: true, //配置自动启动浏览器
disableHostCheck: true, // 本地开发外部可以访问
proxy: {
// 配置多个代理(配置一个 proxy: 'http://localhost:4000' )
"/app-api": {
// target: "http://121.43.134.227:9100",
// target: "http://192.168.3.55:9100",
// target: "https://www.jaxc.cn",
target: "http://192.168.1.37:8318",
ws: true, //如果要代理 websockets,配置这个参数
changeOrigin: true,
// pathRewrite:{
// '^/api':'/gzpt'
// }
},
},
},
};