Skip to content
This repository has been archived by the owner on Aug 4, 2021. It is now read-only.

can't use @babel/preset-typescript #261

Closed
Tomekmularczyk opened this issue Oct 3, 2018 · 3 comments
Closed

can't use @babel/preset-typescript #261

Tomekmularczyk opened this issue Oct 3, 2018 · 3 comments

Comments

@Tomekmularczyk
Copy link

Tomekmularczyk commented Oct 3, 2018

Hi and thanks for the plugin,

I want to use typescript so I thought it will be as straightforward as adding @babel/plugin-typescript to the .babelrc but this somehow doesn't strip the types from the file. I wonder why this happens and if I can fix it or do I have to use something like rollup-plugin-typescript2.

Here is how I tried to get it working - https://github.com/Tomekmularczyk/react-package-rollup/tree/with-typescript

P.S Also, I don't understand WHY rollup-plugin-typescript section points to this package.

@Andarist
Copy link
Member

Andarist commented Oct 3, 2018

P.S Also, I don't understand WHY rollup-plugin-typescript section points to this package.

I guess it's about Why section, so basically it's referring to this - https://github.com/rollup/rollup-plugin-babel#why . This cross reference is confusing, so maybe it's worth to send a PR to the rollup-plugin-typescript with copy-pasted-adjusted section from this repo?

Anyway - you are probably looking for options.extensions, you have to tell babel to transpile .ts files.

@Tomekmularczyk
Copy link
Author

@Andarist thanks! I also found a #255 meanwhile and now it works.

About the PR... I could make it, but I don't know enough details. I'm still confused why what is pointed out in the #why-section is the reason for the rollup-plugin-typescript package. Is it about performance or some additional configuration?

@Andarist
Copy link
Member

Andarist commented Oct 3, 2018

I think it's just about config complexity - kinda easier to have a single tool which combines multiple other tools (with plugins) to create a final output from the raw input rather than creating carefully a pipeline from those tools where each gets intermediate results.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants