You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,11 +47,9 @@ Beware of TypeScript boilerplates using Babel transformation step after the Type
47
47
- Generators - TypeScript Team have dropped adding support for generator transformation to (ES3/ES5) so consider alternative solution covered below (https://github.com/Microsoft/TypeScript/issues/3975#issuecomment-250859415)
48
48
49
49
__Alternative solution to resolve Generator transformation to ES3/ES5:__
50
-
My solution promote using [Facebook Regenerator Project](https://github.com/facebook/regenerator) (as Babel internally doing the same!) which is executed only for app.js bundle after building for production.
51
-
Use seperate CLI command `npm run regenerator` to transform app.js generated eariler with `npm run build:app` command, or run an alias command to run it automatically with each build `npm run build:regenerator`.
50
+
My solution prefer using only [Facebook Regenerator Project](https://github.com/facebook/regenerator) instead of adding Babel as dependency _(__NOTE:__ Babel internally is using the same approach, running "regenerator runtime" internally for async and generator functions transformations - https://babeljs.io/docs/usage/caveats/)_
52
51
53
-
__NOTE: This is the same as Babel, because Babel is using "regenerator runtime" internally for async/generator functions transformations. So, why TS shouldn't be doing the same?__
When building for production use seperate CLI command `npm run regenerator` just after a build command to apply transform to app.js bundle, or run an alias command instead to run it automatically with each build `npm run build:regenerator`.
0 commit comments