Skip to content
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

import.meta.resolve runtime #572

Merged
merged 1 commit into from
Jan 20, 2024
Merged

Conversation

mbostock
Copy link
Member

This makes observable preview work from a global install, without having to install the CLI locally!

@mbostock mbostock requested review from Fil and trebor January 19, 2024 23:48
const EXTRA_FILES = new Map([["node_modules/@observablehq/runtime/dist/runtime.js", "_observablehq/runtime.js"]]);
const EXTRA_FILES = new Map([
[
join(fileURLToPath(import.meta.resolve("@observablehq/runtime")), "../../dist/runtime.js"),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should declare this export in the runtime package… I’ll file an issue, but I think this is best for now.

Copy link
Contributor

@trebor trebor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested and works.

@mbostock mbostock merged commit febf851 into main Jan 20, 2024
2 checks passed
@mbostock mbostock deleted the mbostock/fix-runtime-resolution branch January 20, 2024 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants