use import

This commit is contained in:
tamaina 2022-04-23 16:32:58 +09:00
parent 8a850fbe6b
commit 77fef4ee23

View file

@ -58,14 +58,11 @@
? `?salt=${localStorage.getItem('salt')}` ? `?salt=${localStorage.getItem('salt')}`
: ''; : '';
const script = document.createElement('script'); import(`/assets/${CLIENT_ENTRY}${salt}`)
script.setAttribute('src', `/assets/${CLIENT_ENTRY}${salt}`); .catch(async () => {
script.setAttribute('type', 'module');
script.addEventListener('error', async () => {
await checkUpdate(); await checkUpdate();
renderError('APP_FETCH_FAILED'); renderError('APP_FETCH_FAILED');
}); });
document.head.appendChild(script);
//#endregion //#endregion
//#region Theme //#region Theme