Skip to content

Conversation

@JakeChampion
Copy link
Contributor

currently this package is published in this structure:

dist/
├── bootstrap
│   ├── main.cjs
│   ├── main.d.cts
│   ├── main.d.ts
│   └── main.js
├── cache-854474ad.d.ts
├── chunk-DZNRKSSF.js
├── main.cjs
├── main.d.cts
├── main.d.ts
└── main.js

if we try to cache this package using deno, right now it will end up with a file structure like this:

vendor
├── cdn.jsdelivr.net
│   └── npm
│       └── @netlify
│           └── [email protected]
│               └── dist
│                   ├── #chunk-i5fzdz6v_a8179.js
│                   └── bootstrap
│                       └── main.js

this is incorrect because ./dist/bootstrap/main.js wants to import from "../chunk-I5FZDZ6V.js" but that file does not exist, deno has named the file #chunk-i5fzdz6v_a8179.js

we can work around this issue by ensuring we do not code split the files, so that our published package becomes this:

dist/
├── bootstrap
│   ├── main.cjs
│   ├── main.d.cts
│   ├── main.d.ts
│   └── main.js
├── cache-854474ad.d.ts
├── main.cjs
├── main.d.cts
├── main.d.ts
└── main.js

…o cache` functionality

currently this package is published in this structure:
```
dist/
├── bootstrap
│   ├── main.cjs
│   ├── main.d.cts
│   ├── main.d.ts
│   └── main.js
├── cache-854474ad.d.ts
├── chunk-DZNRKSSF.js
├── main.cjs
├── main.d.cts
├── main.d.ts
└── main.js
```

if we try to cache this package using deno, right now it will end up with a file structure like this:
```
vendor
├── cdn.jsdelivr.net
│   └── npm
│       └── @netlify
│           └── [email protected]
│               └── dist
│                   ├── #chunk-i5fzdz6v_a8179.js
│                   └── bootstrap
│                       └── main.js
```

this is incorrect because ./dist/bootstrap/main.js wants to import from `"../chunk-I5FZDZ6V.js"` but that file does not exist, deno has named the file `#chunk-i5fzdz6v_a8179.js`

we can work around this issue by ensuring we do not code split the files, so that our published package becomes this:
```
dist/
├── bootstrap
│   ├── main.cjs
│   ├── main.d.cts
│   ├── main.d.ts
│   └── main.js
├── cache-854474ad.d.ts
├── main.cjs
├── main.d.cts
├── main.d.ts
└── main.js
```
@JakeChampion JakeChampion merged commit 557a0c1 into main Mar 18, 2025
22 checks passed
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.

3 participants