DenoDDeno
Powered by
SembianceS
Denoβ€’3y agoβ€’
7 replies
Sembiance

Force await import() to import a fresh copy?

I have a Deno instance that dynamically loads a module with:
await import("some/module.js")
await import("some/module.js")

The module changes on disk and now I want the running deno instance to import it again getting the fresh changes. I was accomplishing this by adding a random number like
await import("some/module.js?v=" + Date.now().toString())
await import("some/module.js?v=" + Date.now().toString())
which deno then views as a new file and happily loads it.
Problem is, over time, this caused my deno
dep_analysis_cache
dep_analysis_cache
files on disk to become HUGE (1GB+).
Is there a magic way I can force deno when I call import() to always import a fresh copy?
Or some whay to clear the already loaded cached content?
Or should I just stay on top of the dep_analysis_Cache bloat and delete them when they get big?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

`await import()` without global execution
MrKleeblattMMrKleeblatt / help
3y ago
How to import the Image class to Deno Fresh?
PonchoPPoncho / help
4y ago
Fresh: front end import map goes where?
capo_grecoCcapo_greco / help
2y ago