tacker

a simple web bundler
git clone https://tongong.net/git/tacker.git
Log | Files | Refs | README

commit a41634bfce51b3da11c93dc356b59f6e75dd669b
parent 165070b0db8224fe041b2c7be9d0b20c46527a5f
Author: tongong <tongong@gmx.net>
Date:   Sun, 24 Jul 2022 08:52:16 +0200

added async modules with top-level await

Diffstat:
Mbundle_js.ha | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bundle_js.ha b/bundle_js.ha @@ -40,9 +40,9 @@ fn tacker_js(inputpath: str, ofile: io::handle, html: bool) void = { dep_add(void, inputpath, &g); const sorting = sort_kahn(g, inputpath); defer free(sorting); - fmt::fprintln(ofile, "(function() {")!; + fmt::fprintln(ofile, "(async function() {")!; for (let i = 0z; i < len(sorting); i += 1) { - fmt::fprintfln(ofile, "const _tacker{} = (function() {{", sorting[i])!; + fmt::fprintfln(ofile, "const _tacker{} = await (async function() {{", sorting[i])!; fmt::fprintln(ofile, "const module = { exports: {} }, exports = module.exports;")!; emit_bundled(g[sorting[i]].path, ofile, g); fmt::fprintln(ofile, "\nreturn module.exports;")!;