Right now, this just uses the defaultResolver of the unofficial compiler, meaning it imports from observablehq.com notebook directly.
But, it would be cool to support local notebooks that are in your file system. For example, you could have:
$ ls
main.notebook.js other.notebook.js
Then, in main.notebook.js:
import {test} from "./other.notebook.js"
test should now have the test variable from the local other.notebook.js.
This would involve creating a new resolve function and passing it into the Compile constructor. The defaultResolver is a good example to work off of.
Maybe it should be a setting too - since maybe this is a security concern?
Right now, this just uses the
defaultResolverof the unofficial compiler, meaning it imports from observablehq.com notebook directly.But, it would be cool to support local notebooks that are in your file system. For example, you could have:
Then, in
main.notebook.js:testshould now have thetestvariable from the localother.notebook.js.This would involve creating a new
resolvefunction and passing it into theCompile constructor. ThedefaultResolveris a good example to work off of.Maybe it should be a setting too - since maybe this is a security concern?