You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -135,6 +135,7 @@ type ModuleOptions = {
135
135
idiomaticExports?:'off'|'safe'|'aggressive'
136
136
topLevelAwait?:'error'|'wrap'|'preserve'
137
137
out?: string
138
+
cwd?: string
138
139
inPlace?: boolean
139
140
}
140
141
```
@@ -159,7 +160,7 @@ type ModuleOptions = {
159
160
- `cjsDefault` (`auto`): bundler-style default interop vs direct `module.exports`.
160
161
- `idiomaticExports` (`safe`): when raising CJS to ESM, attempt to synthesize `export` statements directly when it is safe. `off` always uses the helper bag; `aggressive` currently matches `safe` heuristics.
161
162
- `out`/`inPlace`: write the transformed code to a file; otherwise the function returns the transformed string only.
162
-
- CommonJS → ESM lowering will throw on `with` statements and unshadowed `eval` calls to avoid unsound rewrites.
163
+
- `cwd` (`process.cwd()`): Base directory used to resolve relative `out` paths.
163
164
164
165
> [!NOTE]
165
166
> Package-level metadata (`package.json` updates such as setting `"type": "module"` or authoring `exports`) is not edited by this tool today; plan that change outside the per-file transform.
0 commit comments