在 node.js 我们可以使用
delete require.cache[require.resolve(somePath)];
在运行时删除需要缓存。
有没有类似的方法来删除 deno 中的运行时导入缓存?
最佳答案
-r
或 --reload
选项将重新编译导入的模块。
-r, --reload=<CACHE_BLACKLIST> Reload source code cache (recompile TypeScript)
https://deno.land/manual#other-key-behaviors
Other key behaviors
- Remote code is fetched and cached on first execution, and never updated until the code is run with the --reload flag. (So, this will still work on an airplane.)
- Modules/files loaded from remote URLs are intended to be immutable and cacheable.
您可以传递参数以重新加载特定模块:
--reload=https://deno.land/std
https://deno.land/manual/linking_to_external_code/reloading_modules
关于node.js - 如何在 deno 中删除运行时导入缓存?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61903993/