tsc
nearly works but I can't get it to output .mjs
files. swc
doesn't want to output .mjs
nor the .d.ts
files.
Is there a comprehensive bundler that'll do both?
Ideally I want to point it at my index.ts
file which just looks like this
export * from './map'
export * from './set'
export * from './array'
And then it will find the other files and compile them. Anything not in the import/export chain should be omitted from the output, but if I have to compile my entire src
dir I can live with that.
Additional constraints:
- The compiled JS should include file extensions in its import/export statements: https://stackoverflow.com/a/68783000/65387
- I don't want to include
.js
in my source code when trying to import a.ts
file (https://stackoverflow.com/a/62626938/65387)
- I don't want to include
I think I can work around the .mjs
file extension by adding "type": "module"
to package.json
. But I still need the import/export statements to be re-written properly (with extension)