uniapp 跳转外部链接
aboutLearnMore() {
// 跳转外部链接h5
// #ifdef H5
window.location.href = 'http://www.baidu.com';
// #endif
// #ifdef APP-PLUS
plus.runtime.openURL('http://www.baidu.com') //不需要拼接
// plus.runtime.openURL(`http://${jumpUrl}`)//需要拼接
// #endif
},
uniapp 发布h5前端项目时因chunk-vendors过大导致首屏加载太慢
- 安装插件
compression-webpack-plugin
npm install compression-webpack-plugin@6.1.1 --save-dev
- 安装webpack
npm install webpack@4.46.0 --save-dev
- 新建web.config.js
const CompressionWebpackPlugin = require('compression-webpack-plugin');
module.exports = {
configureWebpack:{
plugins:[
new CompressionWebpackPlugin(
{
filename: "[path][base].gz",
algorithm: "gzip",
test: /\.js$/,
threshold: 10240,
minRatio: 0.8,
exclude: /node_modules/,
}
)
]
}
}
nginx配置gzip
# gzip config
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_disable "MSIE [1-6]\.";
文章来源地址https://www.toymoban.com/news/detail-501667.html
文章来源:https://www.toymoban.com/news/detail-501667.html
到了这里,关于uniapp 发布h5前端项目时因chunk-vendors过大导致首屏加载太慢以及跳转外部链接的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!