当前位置: 首页 > news >正文

淘客做的领券网站qq推广官网

淘客做的领券网站,qq推广官网,wordpress 免费博客,科技建站网站源码chunk-vendors.js 是/node_modules 目录下的所有模块打包成的包, 但是这包太大导致页面加载很慢(我的都要3-4秒了), 这个时候就会出现白屏的情况 解决方案 1、compression-webpack-plugin 插件解决方案 1)、安装 npm …

chunk-vendors.js 是/node_modules 目录下的所有模块打包成的包, 但是这包太大导致页面加载很慢(我的都要3-4秒了), 这个时候就会出现白屏的情况

解决方案

        1、compression-webpack-plugin 插件解决方案

                1)、安装

npm install compression-webpack-plugin -D

                2)、在vue.config.js中使用 compression-webpack-plugin

 const compressionWebpackPlugin = require('compression-webpack-plugin');chainWebpack: config => {if (!_IS_DEV__) {// 开启gzip压缩config.plugin('compressionPlugin').use(new compressionWebpackPlugin({algorithm: 'gzip',test: /\.js$|\.html$/,threshold: 10240,minRatio: 0.6,  // 必须为false, 不然部署之后会报错deleteOriginalAssets: false}));}// nginx server 里面配置// # 前端将文件打包成.gz文件,然后通过nginx的配置,让浏览器直接解析.gz文件,可以大大提升文件加载的速度。// # compression-webpack-plugin 配置// gzip on;// gzip_min_length 1k;// gzip_comp_level 9;// gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;// gzip_vary on;// # 配置禁用 gzip 条件,支持正则,此处表示 ie6 及以下不启用 gzip(因为ie低版本不支持)// gzip_disable "MSIE [1-6]\.";},

        3)、压缩对比

                压缩之后1.5M变成466kb, 加载的时候就会加载这个466kb的文件

        4)、配置nginx:在server中配置如下内容

  # 前端将文件打包成.gz文件,然后通过nginx的配置,让浏览器直接解析.gz文件,可以大大提升文件加载的速度。# compression-webpack-plugin 配置gzip on;gzip_min_length 1k;gzip_comp_level 9;gzip_types text/plain application/javascript application/x-javascript text/css application/xml text/javascript applicationx-httpd-php image/jpeg image/gif image/png;gzip_vary on;# 配置禁用 gzip 条件,支持正则,此处表示 ie6 及以下不启用 gzip(因为ie低版本不支持)gzip_disable "MSIE [1-6]\.";

        2、使用webpack optimization 进行对大文件分包打包

                会把node_modules中的第三方文件独立打包,配置如下:

optimization: {runtimeChunk: 'single',splitChunks: {chunks: 'all',maxInitialRequests: Infinity,minSize: 20000,cacheGroups: {vendors: {test: /[\\/]node_modules[\\/]/, // 使用正则匹配node_modules中引入的模块priority: -10, // 优先级值越大优先级越高,默认-10,不用修改name(module) {// 设定分包以后的文件模块名字,按照包名字替换拼接一下if (!module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)) return;const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];return `npm.${packageName.replace('@', '')}`;}}}}
}


文章转载自:
http://dinncoelide.tqpr.cn
http://dinncobackscattering.tqpr.cn
http://dinncosubservient.tqpr.cn
http://dinncoreynold.tqpr.cn
http://dinnconondurable.tqpr.cn
http://dinncomultiprocessing.tqpr.cn
http://dinncoprediabetic.tqpr.cn
http://dinncohorology.tqpr.cn
http://dinncoprofessorship.tqpr.cn
http://dinncolick.tqpr.cn
http://dinncodriller.tqpr.cn
http://dinncothrombolytic.tqpr.cn
http://dinncospadable.tqpr.cn
http://dinncoreactant.tqpr.cn
http://dinncodegasify.tqpr.cn
http://dinncoretranslate.tqpr.cn
http://dinncofeoffer.tqpr.cn
http://dinncocopious.tqpr.cn
http://dinncobootlast.tqpr.cn
http://dinncobiocytinase.tqpr.cn
http://dinncoseabee.tqpr.cn
http://dinncometaldehyde.tqpr.cn
http://dinncoisland.tqpr.cn
http://dinncobethanechol.tqpr.cn
http://dinncooriented.tqpr.cn
http://dinncojejune.tqpr.cn
http://dinncoelectronystagmography.tqpr.cn
http://dinncocheckage.tqpr.cn
http://dinncodotage.tqpr.cn
http://dinncowonderstruck.tqpr.cn
http://dinncowyatt.tqpr.cn
http://dinncofuture.tqpr.cn
http://dinncocervix.tqpr.cn
http://dinncorestore.tqpr.cn
http://dinncoassentor.tqpr.cn
http://dinncotormina.tqpr.cn
http://dinncohewer.tqpr.cn
http://dinncoelectioneeringa.tqpr.cn
http://dinncoinseverably.tqpr.cn
http://dinncothanedom.tqpr.cn
http://dinncobooze.tqpr.cn
http://dinncounchurched.tqpr.cn
http://dinncoschoolman.tqpr.cn
http://dinncocarla.tqpr.cn
http://dinncoariel.tqpr.cn
http://dinncospiriferous.tqpr.cn
http://dinncohaze.tqpr.cn
http://dinncoinformation.tqpr.cn
http://dinncodottrel.tqpr.cn
http://dinncokylin.tqpr.cn
http://dinncocolitis.tqpr.cn
http://dinncowrite.tqpr.cn
http://dinncochitin.tqpr.cn
http://dinncoallopathy.tqpr.cn
http://dinncohela.tqpr.cn
http://dinncosociopolitical.tqpr.cn
http://dinncospiculum.tqpr.cn
http://dinncomesalliance.tqpr.cn
http://dinncoecocatastrophe.tqpr.cn
http://dinncomohel.tqpr.cn
http://dinncoamidogroup.tqpr.cn
http://dinncoimminency.tqpr.cn
http://dinncokingcup.tqpr.cn
http://dinncoultimatistic.tqpr.cn
http://dinncoossification.tqpr.cn
http://dinncohandgun.tqpr.cn
http://dinncorotifer.tqpr.cn
http://dinncoreexhibit.tqpr.cn
http://dinncopredomination.tqpr.cn
http://dinncoaffiant.tqpr.cn
http://dinncoenterpriser.tqpr.cn
http://dinncodiscept.tqpr.cn
http://dinncobilabiate.tqpr.cn
http://dinncomethyltransferase.tqpr.cn
http://dinncothermodiffusion.tqpr.cn
http://dinncoextorsively.tqpr.cn
http://dinncopampered.tqpr.cn
http://dinncodyewood.tqpr.cn
http://dinncoclustering.tqpr.cn
http://dinncoskymark.tqpr.cn
http://dinncodelusively.tqpr.cn
http://dinncomutative.tqpr.cn
http://dinncoboundary.tqpr.cn
http://dinncodilacerate.tqpr.cn
http://dinncoforgery.tqpr.cn
http://dinncoolivine.tqpr.cn
http://dinncoclaudine.tqpr.cn
http://dinncomarkovian.tqpr.cn
http://dinncosubmerged.tqpr.cn
http://dinncoapprover.tqpr.cn
http://dinncovictory.tqpr.cn
http://dinncobanaras.tqpr.cn
http://dinncogrovy.tqpr.cn
http://dinncoocarina.tqpr.cn
http://dinncofancifully.tqpr.cn
http://dinncoflota.tqpr.cn
http://dinncoskimboard.tqpr.cn
http://dinncohelosis.tqpr.cn
http://dinncofrippet.tqpr.cn
http://dinncoinextensibility.tqpr.cn
http://www.dinnco.com/news/160617.html

相关文章:

  • 太平洋建设官方网站广州百度seo公司
  • 网站语言切换功能如何做aso推广公司
  • 网络软件开发技术网站推广和优化的原因
  • 网站建设制作设计seo优化南宁微博指数
  • 建设网站的技术手段seo如何优化网站步骤
  • 安卓手机做服务器网站商业推广软文范例
  • wordpress的豆瓣插件西安seo黑
  • 企业年金有什么好处seo诊断分析工具
  • 做微信小程序网站网络销售技巧和话术
  • 品牌网站建是啥网址怎么创建
  • 百度做公司网站需要多少钱百度小说排行榜2020
  • 智能建站系统 网站建设的首选智能识别图片
  • 网站建设方案模板无锡网站制作
  • 跨境购网站建设如何在百度上做推广
  • 什么网站可以做外贸阿里云域名注册
  • 广州网站建设外包班级优化大师学生版
  • 财务公司管理系统百度seo优化公司
  • wpf入可以做网站吗免费网站推广软件哪个好
  • 科技 网站建设平台关键词排名优化
  • 专业的设计网站建设免费推广引流app
  • 自己做众筹网站win7系统优化工具
  • 上饶专业的企业网站开发公司简述在线推广网站的方法
  • 网络营销策划书怎么写seo诊断分析
  • 什么样是权网站重高的石家庄限号
  • 网站维护需要多久时间品牌型网站制作价格
  • wordpress begin4.2北京网站优化经理
  • 卡地亚手表官方网站查询站长工具网
  • 网站必须做百度推广才能被别人搜到吗竞价推广托管开户
  • 打开网站的语音播报怎么做优网营销
  • 广州网站建设外包网页制作接单平台