Skip to content

Transitive imports are not identified as file attachments #76

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

Closed
mbostock opened this issue Oct 29, 2023 · 1 comment
Closed

Transitive imports are not identified as file attachments #76

mbostock opened this issue Oct 29, 2023 · 1 comment
Assignees
Labels
bug Something isn’t working

Comments

@mbostock
Copy link
Member

For example, if I have a JavaScript cell:

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

And then foo.js imports bar.js:

export const foo = "foo";
export {bar} from "./bar.js";

And bar.js:

export const bar = "bar";

Then foo.js is correctly identified as a file attachment, but bar.js is not.

Fixed in #40.

@mbostock mbostock added the bug Something isn’t working label Oct 29, 2023
@mbostock mbostock mentioned this issue Oct 29, 2023
1 task
@cinxmo
Copy link
Contributor

cinxmo commented Nov 7, 2023

Transitive imports are promoted as file attachments in #40. But transitive imports are not rewritten properly. for example:
in a .md file:

```js
import {bar} from "./bar.js"
```

will get rewritten as

const {bar} = await import("/_file/bar.js");

but in bar.js this will not be rewritten

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

@cinxmo cinxmo closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn’t working
Projects
None yet
Development

No branches or pull requests

2 participants