cyl/dev
zsk 3 years ago
parent 8c4333c625
commit 0ddd23f5a9

@ -1,8 +1,8 @@
let plugins = []; let plugins = [];
// production // production
if (process.env.NODE_ENV === "production") { // if (process.env.NODE_ENV === "production") {
plugins = ["transform-remove-console"]; // plugins = ["transform-remove-console"];
} // }
module.exports = { module.exports = {
presets: ["@vue/cli-plugin-babel/preset"], presets: ["@vue/cli-plugin-babel/preset"],
plugins: [ plugins: [

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

@ -10,7 +10,7 @@
<i class="iconfont" style="margin-bottom: 0"> <i class="iconfont" style="margin-bottom: 0">
<img <img
src="http://matripe.oss-cn-beijing.aliyuncs.com/bcSVG/zzLogo.svg" src="http://matripe.oss-cn-beijing.aliyuncs.com/bcSVG/zzLogo.svg"
style="width: 80px !important; height: 80px" style="width: 100px !important; height: 100px"
alt="" alt=""
/> />
</i> </i>

@ -13,8 +13,8 @@ console.log(baseURL);
axios.defaults.withCredentials = true; //添加这行代码 axios.defaults.withCredentials = true; //添加这行代码
// console.log(axios); // console.log(axios);
const service = axios.create({ const service = axios.create({
baseURL: "/api_prod", // url = base url + request url 测试 // baseURL: "/api_prod", // url = base url + request url 测试
// baseURL: baseURL, // baseURL: "/api", // url = base url + request url 正式 baseURL: baseURL, // baseURL: "/api", // url = base url + request url 正式
withCredentials: true, // send cookies when cross-domain requests withCredentials: true, // send cookies when cross-domain requests
timeout: 60000, // request timeout timeout: 60000, // request timeout
crossDomain: true, crossDomain: true,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

@ -1,8 +1,8 @@
"use strict"; "use strict";
const path = require("path"); const path = require("path");
const defaultSettings = require("./src/settings.js"); const defaultSettings = require("./src/settings.js");
const webpack = require("webpack"); // const webpack = require("webpack");
const CompressionPlugin = require("compression-webpack-plugin"); // const CompressionPlugin = require("compression-webpack-plugin");
// const zlib = require("zlib"); // const zlib = require("zlib");
function resolve(dir) { function resolve(dir) {
return path.join(__dirname, dir); return path.join(__dirname, dir);
@ -21,7 +21,6 @@ module.exports = {
productionSourceMap: false, productionSourceMap: false,
devServer: { devServer: {
// 配置反向代理 // 配置反向代理
compress: true, // 配置webpack的压缩,但是在package.json中需要配置 --compress
port: port, port: port,
open: true, open: true,
overlay: { overlay: {
@ -32,9 +31,9 @@ module.exports = {
// 地址中有 /api 的时候会触发代理 // 地址中有 /api 的时候会触发代理
"/api_prod": { "/api_prod": {
// target: "http://localhost:8001/", // target: "http://localhost:8001/",
// target: "http://bl7.matripe.com.cn:8001", //测试修改这个地方 target: "http://bl7.matripe.com.cn:8001",
// target: "http://1shoudan.renminshitang.com.cn", // target: "http://1shoudan.renminshitang.com.cn",
target: "https://d.matripe.com.cn", //正式修改这个地方 // target: "https://d.matripe.com.cn",
ws: true, // proxy websockets ws: true, // proxy websockets
changeOrigin: true, // 确定是否跨域 changeOrigin: true, // 确定是否跨域
pathRewrite: { pathRewrite: {
@ -93,20 +92,20 @@ module.exports = {
"@ant-design/icons/lib/dist.$": resolve("src/icons.js"), "@ant-design/icons/lib/dist.$": resolve("src/icons.js"),
}, },
}, },
plugins: [ // plugins: [
// new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), // new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/),
// // 下面两项配置才是 compression-webpack-plugin 压缩配置 // // 下面两项配置才是 compression-webpack-plugin 压缩配置
// // 压缩成 .gz 文件 // // 压缩成 .gz 文件
// new CompressionPlugin({ // new CompressionPlugin({
// algorithm: "gzip", // filename: '[path][base].gz',
// test: /\.js$|\.html$|\.css/, //匹配文件名 // algorithm: 'gzip',
// test: /\.js$|\.css$|\.html$/,
// threshold: 10240, // threshold: 10240,
// minRatio: 0.8, // minRatio: 0.8
// deleteOriginalAssets: false, // 是否删除源文件
// }), // }),
// 压缩成 .br 文件,如果 zlib 报错无法解决,可以注释这段使用代码,一般本地没问题,需要注意线上服务器会可能发生找不到 zlib 的情况。 // // 压缩成 .br 文件,如果 zlib 报错无法解决,可以注释这段使用代码,一般本地没问题,需要注意线上服务器会可能发生找不到 zlib 的情况。
// new CompressionPlugin({ // new CompressionPlugin({
// filename: '[path].br', // filename: '[path][base].br',
// algorithm: 'brotliCompress', // algorithm: 'brotliCompress',
// test: /\.(js|css|html|svg)$/, // test: /\.(js|css|html|svg)$/,
// compressionOptions: { // compressionOptions: {
@ -115,10 +114,9 @@ module.exports = {
// } // }
// }, // },
// threshold: 10240, // threshold: 10240,
// minRatio: 0.8, // minRatio: 0.8
// deleteOriginalAssets: true //是否删除原文件
// }) // })
], // ],
// }, // },
optimization: { optimization: {
runtimeChunk: "single", runtimeChunk: "single",

Loading…
Cancel
Save