Importing TSGO itself to use with `@rollup/typescript-plugin`
Closed this issue · 5 comments
I want to import TSGO itself, to pass it to Rollup; But @rollup/plugin-typescript doesn't offer an exports/main key in its package.json like the package typescript does.
typescript's package.json
https://github.com/microsoft/TypeScript/blob/233f392d675ccf7da3cf27d628b503d0a9302332/package.json#L22-L27
TSGO's package.json:
https://github.com/microsoft/typescript-go/blob/1ca5a2d97b0c2b93cfc32137c8922185b4f41df0/package.json
typescript({
typescript: require('some-fork-of-typescript')
});I am not sure what you're asking here; the package.json you linked from this repo is our monorepo root and is not an actual package.
We also do not have any public API published yet. There's nothing to import.
What I'm saying is that I want to use Rollup [or Vite] with TSGO.
I created a minimal reproduction at @movahhedi/tsgo-rollup-test.
This is the file I'm pointing at: https://github.com/movahhedi/tsgo-rollup-test/blob/main/rollup.config.js
But you're right. This issue falls under "API" (which I have seen is stated "not ready"), didn't think of that. So guess I'll wait until then.
But is there a way right now?
No, there is no way to do this.
I'll note that vite doesn't even need TS to transpile TS to JS. I don't think rollup does either. Certainly not rolldown.
Rollup needs the @rollup/plugin-typescript plugin to transpile TS.
About Rolldown, The last time I used it it was buggy. But today, it worked like charm! It really is a dropdown replacement.
So my problem is solved; And we can close this issue since tsgo's API is already under dev.
Thanks for the help. Looking forward to tsgo!