Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build for both Node.js and Browsers? #187

Open
ThisIsMissEm opened this issue Jul 14, 2022 · 0 comments
Open

How to build for both Node.js and Browsers? #187

ThisIsMissEm opened this issue Jul 14, 2022 · 0 comments

Comments

@ThisIsMissEm
Copy link

Question

Hi! I've just come across rollup-plugin-ts, and I'm liking what I'm seeing, I do have a question though, which is, how does this play with compiling a single package for both Node.js and Browsers? I currently use the rollup-plugin-typescript2 plugin, which seems to not care, but from what I can tell rollup-plugin-ts, due to supporting browserslist would maybe compile code that would work in browsers but not in node?

Would I need two different plugins? One for Node.js and one for Browsers?

Or would we just set browserslist to something like:

  "browserslist": [
     "last 2 versions",
     "maintained node versions"
   ]

And that would output code that's compatible with both Node.js and browsers?

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

No branches or pull requests

1 participant