use import

This commit is contained in:
tamaina 2022-04-23 16:32:58 +09:00
parent 8a850fbe6b
commit 77fef4ee23
1 changed files with 5 additions and 8 deletions

View File

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