]> git.ardis.lu - static-encrypt/commitdiff
Use normal import instead of dynamic
authorArdis Lu <ardisglu@gmail.com>
Thu, 23 Feb 2023 03:56:17 +0000 (19:56 -0800)
committerArdis Lu <ardisglu@gmail.com>
Thu, 23 Feb 2023 03:56:17 +0000 (19:56 -0800)
Let browser handle async JIT loading

index.html

index 09c3525e0bd06faabf265d2b942c9561743088fe..423a7e89246394142075923cf3415721f33ba519 100644 (file)
   </footer>
 
   <script type="module">
+    import decrypt from '/decrypt.js';
+
     async function encrypt(plaintext, password) {
       const encoder = new TextEncoder();
       const encodedPlaintext = encoder.encode(plaintext);
       a.click();
     }
 
-    const { default: decrypt } = await import('/decrypt.js');
     const template = await fetch('/template.html').then(r => r.text());
     document.querySelector('form').addEventListener('submit', async e => {
       e.preventDefault();
This page took 0.039845 seconds and 4 git commands to generate.