perf: optimize page loading timing, and allow refresh on resource loading issues

reduce white screen time
pull/118/head
moonrailgun 2 years ago
parent 5305b31ebd
commit f48ecfb9e8

@ -43,9 +43,9 @@
tip.style.fontSize = '18px'; tip.style.fontSize = '18px';
tip.style.marginTop = '20px'; tip.style.marginTop = '20px';
tip.style.color = 'gray'; tip.style.color = 'gray';
tip.innerText = navigator.language === 'zh-CN' tip.innerHTML = navigator.language === 'zh-CN'
? '可能资源加载出现了一些问题,请手动刷新重试一下' ? '可能资源加载出现了一些问题,请手动<a style="color: rgb(9, 105, 218);" href="javascript:location.reload()">刷新</a>重试一下'
: 'There may be some problems with resource loading, please refresh manually and try again' : 'There may be some problems with resource loading, please <a style="color: rgb(9, 105, 218);" href="javascript:location.reload()">refresh</a> manually and try again'
el.appendChild(tip) el.appendChild(tip)
} }
}, 10000); }, 10000);

@ -56,7 +56,7 @@ const plugins: Configuration['plugins'] = [
'process.env.VERSION': JSON.stringify(VERSION), 'process.env.VERSION': JSON.stringify(VERSION),
}), }),
new HtmlWebpackPlugin({ new HtmlWebpackPlugin({
inject: true, inject: 'body',
hash: false, hash: false,
favicon: path.resolve(ROOT_PATH, './assets/images/favicon.ico'), favicon: path.resolve(ROOT_PATH, './assets/images/favicon.ico'),
template: path.resolve(ROOT_PATH, './assets/template.html'), template: path.resolve(ROOT_PATH, './assets/template.html'),

Loading…
Cancel
Save