aleph.js
aleph.js copied to clipboard
improve compiler import resolve
using timestamp to replace hash in dev mode to avoid the complex compilation sideEffect.
What complex compilation side effect?
@shadowtime2000 please check https://github.com/alephjs/aleph.js/blob/05592c5aae90e06f5a6641fda7ef28c599915e8b/server/app.ts#L1038
i want to remove the hash in import urls, because when a module changed, we need to update the dep graph, but if without hash the ssr will use the cached module in deno cache storage not the re-compiled moudle when module changed.
@shadowtime2000 do you know why this can not work:
const a = await import("data:application/typescript;base64,ZXhwb3J0IGNvbnN0IGEgPSAiYSI7CgpleHBvcnQgZW51bSBBIHsKICBBLAogIEIsCiAgQywKfQo=")
console.log(a.a)
error: Uncaught (in promise) TypeError: Unmapped bare specifier "data:application/typescript;base64,ZXhwb3J0IGNvbnN0IGEgPSAiYSI7CgpleHBvcnQgZW51bSBBIHsKICBBLAogIEIsCiAgQywKfQo="
Strange, seems to work for me @ije
i figured out, if i pass the --import-map option, the data url will break...