-
Notifications
You must be signed in to change notification settings - Fork 4
Webpack + browser target requires additional transpilation #2
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
Comments
Thanks, that makes a lot of sense. TypeScript compiles generators to ES3 quite well, although it includes its own generator runtime which is quite big. Multiply this by the number of files with generators in your project and you'll get a huge overhead. This could be solved by using So I think I'll set the Considering |
Yeah As far as |
Unfortunately, I don't see a way to make |
Just released |
Awesome, looks great. |
I believe this issue applies to a couple of your other typescript-fsa-* projects but I found this one to be the most worrisome so I am filing the bug here.
The issue is that you are shipping ES6 code in the es/ part of this module. By default, webpack looks at the package.json field 'module' first so if anyone using webpack imports this then they are going to get the ES6 generator syntax whether they want it or not. You also ship an ES5 target in lib/ but that is in your 'main' field which webpack won't look at since you have a 'module'.
There are a couple of workarounds for anyone encountering this:
resolve.mainFields
array to have 'main' first (note: this will affect all imports)There are several fixes that I can think of:
This lib works fine as-is in Chrome because it seems to support the generator syntax. This really becomes an issue when you need to work with IE
The text was updated successfully, but these errors were encountered: