-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More import options #10
Comments
+1 on the npm import. Is there a way to use jsdelivr now? |
@Jiahao01121 yup, Dataflow uses the same // notebook.ojs
moment = require("moment")
moment(new Date) imports moment from jsdelivr. |
+1 for local imports, this can be a big + vs observablehq for local js dev I use a workaround to bring local js into observablehq, which also works for dataflow, but dataflow workflow has much nicer potential with local imports (workaround = https://observablehq.com/@observablehq/require section URL) |
For gists, etc., this works for me in the import resolver: fetch(path)
.then((res) => res.text())
.then((js) => {
const blob = new Blob([js], {
type: 'text/javascript',
});
const objectURL = URL.createObjectURL(blob);
return objectURL;
}) |
Only observablehq and local imports are supported now. Here are other places we should support importing from:
.js
file on the internet that has aexport default function define()
definition.js
file that has aexport default function define()
definitionThe text was updated successfully, but these errors were encountered: