Skip to content

Support npm protocol imports in imported local modules #115

@mbostock

Description

@mbostock

For example, if I have a JavaScript cell in a Markdown file docs/index.md:

```js
import {foo}  from "./foo.js";
```

And then foo.js imports D3 using an npm protocol import:

import * as d3 from "npm:d3";

export const foo = d3.utcDay();

The import will fail because it is not rewritten (to https://cdn.jsdelivr.net/npm/d3/+esm). This was originally supported with import maps, but since we removed import maps in #101 to improve incremental update #14, it regressed. But we need to rewrite imported local modules anyway for #78.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions