`--dynamic` compilation mode, specifically handling of named re-exports in npm packages.
Raw Developer Origin & Technical Request
GitHub Issue
Jul 27, 2026
Hi! Enjoying scriptc a lot — it took a small Markdown→JSON CLI of mine from 58 MB (`bun build --compile`) to 2.8 MB, which is a lovely result.
One thing currently blocks `--dynamic` for most npm packages: **named re-exports (`export { X } from '...'`) in embedded package code don't link.** The build succeeds with no diagnostic, then the binary throws at startup.
### Repro (2-file package, no dependencies)
```js
// node_modules/dirbarrel/impl.js
export const VALUE = "hi";
```
```js
// node_modules/dirbarrel/index.js
export { VALUE } from './impl';
```
```json
// node_modules/dirbarrel/package.json
{ "name": "dirbarrel", "version": "1.0.0", "main": "index.js", "module": "index.js", "types": "index.d.ts" }
```
```ts
// node_modules/dirbarrel/index.d.ts
export declare const VALUE: string;
```
```ts
// main.ts
import { VALUE } from "dirbarrel";
console.log(`VALUE = ${VALUE}`);
```
```
$ bun run main.ts # (or node) → VALUE = hi
$ scriptc build main.ts --dynamic -o out
$ ./out
Uncaught SyntaxError: Could not find export 'VALUE' in module '.../node_modules/dirbarrel/ind'
```
### What I narrowed down
- `'./impl'` vs `'./impl.js'` — same failure
- flat vs nested directories, one level vs three — same failure
- replacing the re-export with a direct `export const` — **works**
So it looks like named re-exports aren't linked in the island, rather than anything to do with path resolution.
Possibly related clue: the module path in the message is sometimes truncated (`/ind` ins...
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from vercel-labs/scriptc.
Frequently Asked Questions
Market intelligence mapped to `--dynamic` compilation mode, specifically handling of named re-exports in npm packages..
What is the technical positioning of `--dynamic` compilation mode, specifically handling of named re-exports in npm packages.?
What are the foundational technologies related to `--dynamic` compilation mode, specifically handling of named re-exports in npm packages.?
Engagement Signals
Cross-Market Term Frequency
Quantifies the cross-market adoption of foundational terms like bun build --compile and --dynamic by tracking occurrence frequency across active SaaS architectures and enterprise developer debates.
SaaS Metrics