首页 > 其他 > 详细

vue首页白屏

时间:2021-05-31 15:48:11      阅读:10      评论:0      收藏:0      [点我收藏+]
下载 npm i compression-webpack-plugin -D
const CompressionPlugin = require("compression-webpack-plugin")
module.exports ={
    configureWebpack: () => {
        if (process.env.NODE_ENV === ‘production‘) {
          return {
            plugins: [
              new CompressionPlugin({
                test: /\.js$|\.html$|\.css$|\.jpg$|\.jpeg$|\.png/, // 需要压缩的文件类型
                threshold: 10240, // 归档需要进行压缩的文件大小最小值,我这个是10K以上的进行压缩
                deleteOriginalAssets: false, // 是否删除原文件
                minRatio: 0.8
              })
            ]
          }
        }
    },
    lintOnSave:false,
    outputDir:‘dist‘,
    assetsDir:‘static‘,
    productionSourceMap:false,
    transpileDependencies: [‘vuex-persist‘],
    publicPath:‘./‘ ,
    devServer:{
        open:true,
        host:‘0.0.0.0‘,
        port:8081,
        hotOnly:false,
        proxy:{
            // https://open.weixin.qq.com
            ‘/api‘:{
                //服务器端接口地址
                target:‘http://192.168.0.150:8081‘,
                // target:‘http://h5.u2sy.cn/‘,
                ws:true,
                //是否跨域
                changeOrigin:true,
                pathRewrite:{
                    ‘^/api‘:‘‘
                }
            }
        }
    }
}

vue首页白屏

原文:https://www.cnblogs.com/zjxzhj/p/14831340.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!