Commit d26c773
committed
feat(cli): add ESM config loader
This is a conventional 'best-effort' approach for loading ESM modules
dynamically and dealing with the asynchronicity.
With some refactoring of the configuration loader logic, instead
`lib/nodejs/esm-utils.js::requireOrImport` could be reutilized deduplicating any
logic in regards to handling ESM. ESM support in Node.js is stable and I doubt
there will be any major changes to the way it is supported, but still,
deduplication is always nice, and there might be some slight adjustments to the
Node.js module resolution algorithm (https://nodejs.org/api/esm.html#resolution-algorithm)
Implements: #50491 parent 639904b commit d26c773
1 file changed
+25
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
52 | 75 | | |
53 | 76 | | |
54 | 77 | | |
| |||
73 | 96 | | |
74 | 97 | | |
75 | 98 | | |
| 99 | + | |
| 100 | + | |
76 | 101 | | |
77 | 102 | | |
78 | 103 | | |
| |||
0 commit comments