2020-11-01 19:37:30 +08:00
|
|
|
|
// vue.config.js
|
2023-02-28 18:56:10 +08:00
|
|
|
|
const HOST = process.env.proxy_host;
|
2023-02-28 19:32:24 +08:00
|
|
|
|
console.log(process.env.proxy_host, HOST);
|
2021-12-10 13:30:40 +08:00
|
|
|
|
const Timestamp = new Date().getTime();
|
2022-02-08 10:01:13 +08:00
|
|
|
|
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
|
2020-11-01 19:37:30 +08:00
|
|
|
|
module.exports = {
|
|
|
|
|
// 输出目录
|
2021-12-10 13:30:40 +08:00
|
|
|
|
outputDir: "../modules/server/src/main/resources/dist",
|
2021-03-02 13:01:54 +08:00
|
|
|
|
// 控制静态资源使用相对路径
|
2021-12-10 13:30:40 +08:00
|
|
|
|
publicPath: "./",
|
2020-11-02 12:00:39 +08:00
|
|
|
|
// 代理设置
|
|
|
|
|
devServer: {
|
2021-02-23 18:49:02 +08:00
|
|
|
|
port: 3000,
|
2020-12-01 18:42:53 +08:00
|
|
|
|
proxy: {
|
|
|
|
|
// websocket
|
2021-12-10 13:30:40 +08:00
|
|
|
|
"/ssh": {
|
2022-06-08 12:14:08 +08:00
|
|
|
|
target: `wss://${HOST}`,
|
2020-12-01 18:42:53 +08:00
|
|
|
|
// true/false: if you want to proxy websockets
|
|
|
|
|
ws: false,
|
2021-02-19 14:35:29 +08:00
|
|
|
|
secure: false,
|
2020-12-01 18:42:53 +08:00
|
|
|
|
},
|
2021-12-10 13:30:40 +08:00
|
|
|
|
"/tomcat_log": {
|
2022-06-08 12:14:08 +08:00
|
|
|
|
target: `wss://${HOST}`,
|
2020-12-03 11:56:49 +08:00
|
|
|
|
// true/false: if you want to proxy websockets
|
|
|
|
|
ws: false,
|
2021-02-19 14:35:29 +08:00
|
|
|
|
secure: false,
|
2020-12-03 11:56:49 +08:00
|
|
|
|
},
|
2021-12-10 13:30:40 +08:00
|
|
|
|
"/console": {
|
2022-06-08 12:14:08 +08:00
|
|
|
|
target: `wss://${HOST}`,
|
2020-12-17 16:43:20 +08:00
|
|
|
|
// true/false: if you want to proxy websockets
|
|
|
|
|
ws: false,
|
2021-02-19 14:35:29 +08:00
|
|
|
|
secure: false,
|
2020-12-17 16:43:20 +08:00
|
|
|
|
},
|
2021-12-10 13:30:40 +08:00
|
|
|
|
"/script_run": {
|
2022-06-08 12:14:08 +08:00
|
|
|
|
target: `wss://${HOST}`,
|
2021-02-24 18:25:08 +08:00
|
|
|
|
// true/false: if you want to proxy websockets
|
|
|
|
|
ws: false,
|
|
|
|
|
secure: false,
|
|
|
|
|
},
|
2020-12-01 18:42:53 +08:00
|
|
|
|
// http
|
2021-12-10 13:30:40 +08:00
|
|
|
|
"/*": {
|
2022-06-08 12:14:08 +08:00
|
|
|
|
target: `http://${HOST}`,
|
2021-12-10 13:30:40 +08:00
|
|
|
|
timeout: 10 * 60 * 1000,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
2023-01-29 09:22:06 +08:00
|
|
|
|
//打包后是否让每个js文件都生成一个.map文件?true代表生成,false代表不生成。
|
|
|
|
|
productionSourceMap: false,
|
2021-12-10 13:30:40 +08:00
|
|
|
|
configureWebpack: {
|
|
|
|
|
// name: name,
|
|
|
|
|
// 修改打包后的js文件名称
|
|
|
|
|
output: {
|
|
|
|
|
// 输出重构 打包编译后的 文件名称 【模块名称.版本号.时间戳】
|
|
|
|
|
filename: `js/[name].[hash].${Timestamp}.js`,
|
|
|
|
|
chunkFilename: `js/[name].[hash].${Timestamp}.js`,
|
2021-02-19 14:35:29 +08:00
|
|
|
|
},
|
2021-12-10 13:30:40 +08:00
|
|
|
|
// 修改打包后的css文件名称
|
|
|
|
|
plugins: [
|
|
|
|
|
new MiniCssExtractPlugin({
|
|
|
|
|
filename: `css/[name].[contenthash].${Timestamp}.css`,
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
// resolve: {
|
|
|
|
|
// alias: {
|
|
|
|
|
// "@": resolve("src")
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
chainWebpack: (config) => {
|
|
|
|
|
config.plugin("html").tap((args) => {
|
|
|
|
|
args[0].title = "Jpom项目管理系统";
|
|
|
|
|
args[0].build = new Date().getTime();
|
2022-02-08 10:01:13 +08:00
|
|
|
|
args[0].env = process.env.NODE_ENV;
|
2022-11-25 23:41:45 +08:00
|
|
|
|
args[0].buildVersion = process.env.npm_package_version;
|
2021-12-10 13:30:40 +08:00
|
|
|
|
return args;
|
|
|
|
|
});
|
2020-11-02 22:29:57 +08:00
|
|
|
|
},
|
2021-12-10 13:30:40 +08:00
|
|
|
|
};
|