Let's do ES modules for browsers that support them
This commit is contained in:
parent
09530efefd
commit
2fc26bf4c6
@ -11,9 +11,11 @@
|
||||
</div>
|
||||
</section>
|
||||
<?php if ($auth->isAuthenticated()): ?>
|
||||
<script async="async" defer="defer" src="<?= $urlGenerator->assetUrl('js/scripts-authed.min.js') ?>"></script>
|
||||
<script nomodule async="async" defer="defer" src="<?= $urlGenerator->assetUrl('js/scripts-authed.min.js') ?>"></script>
|
||||
<script type="module" src="<?= $urlGenerator->assetUrl('js/src/index-authed.js') ?>"></script>
|
||||
<?php else: ?>
|
||||
<script async="async" defer="defer" src="<?= $urlGenerator->assetUrl('js/scripts.min.js') ?>"></script>
|
||||
<script nomodule async="async" defer="defer" src="<?= $urlGenerator->assetUrl('js/scripts.min.js') ?>"></script>
|
||||
<script type="module" src="<?= $urlGenerator->assetUrl('js/src/index.js') ?>"></script>
|
||||
<?php endif ?>
|
||||
</body>
|
||||
</html>
|
@ -1,5 +1,5 @@
|
||||
import _ from './base/AnimeClient'
|
||||
import { renderAnimeSearchResults } from './template-helpers'
|
||||
import _ from './base/AnimeClient.js'
|
||||
import { renderAnimeSearchResults } from './template-helpers.js'
|
||||
|
||||
const search = (query) => {
|
||||
// Show the loader
|
||||
|
@ -1,4 +1,4 @@
|
||||
import _ from './AnimeClient';
|
||||
import _ from './AnimeClient.js';
|
||||
/**
|
||||
* Event handlers
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
import './index';
|
||||
import './index.js';
|
||||
|
||||
import './anime';
|
||||
import './manga';
|
||||
import './anime.js';
|
||||
import './manga.js';
|
||||
|
@ -1,4 +1,4 @@
|
||||
import './base/events';
|
||||
import './base/events.js';
|
||||
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.register('/sw.js').then(reg => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import _ from './base/AnimeClient'
|
||||
import { renderMangaSearchResults } from './template-helpers'
|
||||
import _ from './base/AnimeClient.js'
|
||||
import { renderMangaSearchResults } from './template-helpers.js'
|
||||
|
||||
const search = (query) => {
|
||||
_.$('.cssload-loader')[ 0 ].removeAttribute('hidden');
|
||||
|
6
sw.js
6
sw.js
@ -21,7 +21,7 @@ async function update (request) {
|
||||
return response;
|
||||
}
|
||||
|
||||
function refresh (response) {
|
||||
/* function refresh (response) {
|
||||
return self.clients.matchAll().then(clients => {
|
||||
clients.forEach(client => {
|
||||
const message = {
|
||||
@ -33,7 +33,7 @@ function refresh (response) {
|
||||
client.postMessage(JSON.stringify(message));
|
||||
})
|
||||
});
|
||||
}
|
||||
} */
|
||||
|
||||
self.addEventListener('install', event => {
|
||||
console.log('Public Folder Worker installed');
|
||||
@ -70,6 +70,6 @@ self.addEventListener('fetch', event => {
|
||||
});
|
||||
|
||||
event.waitUntil(
|
||||
update(event.request).then(refresh)
|
||||
update(event.request)
|
||||
);
|
||||
});
|
Loading…
Reference in New Issue
Block a user