代码拉取完成,页面将自动刷新
/**
* @file 打包配置
* @author Iain
* @creation 2021/11/27
*/
const TransformPages = require("uni-read-pages");
// // 开启 Gzip压缩
const CompressionWebpackPlugin = require("compression-webpack-plugin");
const { webpack } = new TransformPages();
// https://cli.vuejs.org/config/
module.exports = {
devServer: {
// host: '0.0.0.0',
// port: '3006',
open: true,
overlay: {
warnings: false,
errors: true,
},
// 配置跨域
// proxy: {
// // api 为转发路径
// "/api": {
// // 目标地址
// target: "http://127.0.0.1:9901",
// },
// },
},
configureWebpack: {
plugins: [
new webpack.DefinePlugin({
ROUTES: webpack.DefinePlugin.runtimeValue(() => {
const tfPages = new TransformPages({
includes: ["path", "name", "meta", "aliasPath"],
});
return JSON.stringify(tfPages.routes);
}, true),
}),
// // 开启 Gzip压缩
// new CompressionWebpackPlugin({
// algorithm: "gzip",
// test: /\.(js|css)$/, // 匹配文件名
// threshold: 10240, // 对超过10k的数据压缩
// deleteOriginalAssets: false, // 不删除源文件
// minRatio: 0.8 // 压缩比
// })
],
},
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。