Modify import paths when transpiling to CJS
Open
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
I'ld like to use `tsup` to transpile the [WebdriverIO project](https://github.com/webdriverio/webdriverio) into ESM and CJS exports. I see the following issue: given I a module with the following import:
```js
import moduleA from './moduleA.js'
```
Now when I transpile the code into `file.js` (ESM) and `file.cjs` (CJS) the `file.cjs` will have the following transpiled code:
```js
var import_moduleA = require("./moduleA.js");
```
which points to the ESM version.
What is the recommended way to setup tsup to allow both exports? Note that bundling into a single file is not an option.
Contributor guide
Assessment
This issue has not been assessed yet.