Thanks! One more question if you’ll indulge me. Suppose my script file just exports one default value:
export default default_value
In observable I follow your suggestion by attaching the file and then doing
m = import(await FileAttachment("script.js").url())
in one cell and then
variable = m.default
in the next and all is well, I can go ahead and use variable
in other cells.
Why can’t I do:
m = (import(await FileAttachment('script.js').url())).default
When I try this, I get m
as undefined
.