Here's some sample code from Nuxt:
import nodeModule from "node:module"
// https://nodejs.org/api/module.html#moduleenablecompilecachecachedir
// https://github.com/nodejs/node/pull/54501
if (nodeModule.enableCompileCache && !process.env.NODE_DISABLE_COMPILE_CACHE) {
try {
const { directory } = nodeModule.enableCompileCache()
if (directory) {
// allow child process to share the same cache directory
process.env.NODE_COMPILE_CACHE ||= directory
}
}
catch {
// Ignore errors
}
}
We could add something similar to bin/elm-review to make Node cache the v8 bytecode between runs.
I don't think our dynamic Elm loading should cause any problems, despite whatever shenanigans we use (I frankly don't remember if we special case anything in there)
Here's some sample code from Nuxt:
We could add something similar to
bin/elm-reviewto make Node cache the v8 bytecode between runs.I don't think our dynamic Elm loading should cause any problems, despite whatever shenanigans we use (I frankly don't remember if we special case anything in there)