Commit 2270aac
Bartek Wrona
Add test verifying EXPORT_ES6 output contains no require() calls
Bundlers (webpack, rollup, vite, esbuild) and frameworks (Next.js, Nuxt)
cannot resolve CommonJS require() calls inside ES modules. This test
statically verifies that EXPORT_ES6 output uses `await import()` instead
of `require()` for Node.js built-in modules, and that the `createRequire`
polyfill pattern is not present.
Parameterized for default, node-only, and pthreads configurations to
cover the various code paths that import Node.js built-ins (fs, path,
url, util, worker_threads).1 parent 6c822be commit 2270aac
1 file changed
+25
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
468 | 493 | | |
469 | 494 | | |
470 | 495 | | |
| |||
0 commit comments