Commit 548e32d
Bartek Wrona
fixup! Replace require() with await import() in EXPORT_ES6 shell/runtime files
fixup! Replace require() with await import() in EXPORT_ES6 shell/runtime files
Drop the per-call `/* webpackIgnore: true */ /* @vite-ignore */`
directives from makeNodeImport's generated `await import(...)` expression.
Reviewer question (r3075818347):
"I won't love having this vender/bundler-specific comments in the code
like this. Didn't you say that these bundlers should automatically
ignore things with the 'node:' prefix?"
Modern webpack 5, vite, and rollup auto-externalize `node:`-prefixed
dynamic imports for browser targets. The hints only suppress a
"externalized for browser compatibility" warning, which
test/vite/vite.config.js already whitelists explicitly for node:*
modules. Correctness is unchanged whether the hints are present or not.
Verified locally:
- other.test_esm_no_require (3 variants) passes.
- emcc -sEXPORT_ES6 -sMODULARIZE produces clean
`await import('node:fs')` / `node:path` / `node:url` calls with
no bundler-specific comment blocks in the output.1 parent f9a9bc8 commit 548e32d
1 file changed
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
961 | 961 | | |
962 | 962 | | |
963 | 963 | | |
964 | | - | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
965 | 970 | | |
966 | 971 | | |
967 | 972 | | |
| |||
0 commit comments