Commit 62c4fe1
committed
fix(bootstrap): load Intl polyfill before logger to prevent smol build failure
Add Intl polyfill import at the top of bootstrap files before any other
imports that use Intl APIs. This fixes the "Intl is not defined" error
in smol Node.js builds (ICU-disabled) where logger's stringWidth function
uses Intl.Segmenter.
Changes:
- Copy intl-stub polyfill from cli/src/polyfills to bootstrap package
- Import polyfill as first statement in bootstrap-npm.mts and bootstrap-smol.mts
- Rebuild bootstrap package to embed polyfill before Intl.Segmenter usage
The polyfill checks if globalThis.Intl exists and only installs stubs if
missing, making it safe for both ICU-enabled and ICU-disabled builds.1 parent f05828a commit 62c4fe1
File tree
7 files changed
+100
-89
lines changed- packages
- bootstrap
- dist
- src
- cli
7 files changed
+100
-89
lines changedSome generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments