Skip to content

Commit

Permalink
fix #34 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
wirekang authored Feb 9, 2024
1 parent 5352c91 commit 117ea6a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/executer/executer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,13 @@ export class Executer {
private makeModule(js: string) {
logger.debug("execute:\n", js);
js = this.replaceImports(js);

// issue 34
js = js + `\n\nawait new Promise(r=>setTimeout(r,0))`;

// prevent module caching
js = js + `\n\nexport const timestamp = ${Date.now()};\n`;

js = encodeURIComponent(js);
return `data:text/javascript;charset=utf-8,${js}`;
}
Expand Down

0 comments on commit 117ea6a

Please sign in to comment.