test: enable importHelpers for UMD builds (#36989)

This is a workaround for a TS 3.9 regression https://github.com/microsoft/TypeScript/issues/38501 where the emitted `__exportStar` helpers have a missing semi-colon at the end of the unnamed function, when targetting UMD, and causes the following runtime error `Uncaught TypeError: (intermediate value)(…) is not a function`.

This is because the anonymous `__exportStar` function will be invoked with the function on the next like as the parameter which is subsequently invoking whatever was returned.

To get around this TS bug, add `importHelpers: true` in your tsconfig. This also, is recommanded to avoid multiple copies of the same helper being inlined, which might cause increase in bundle size.

PR Close #36989
This commit is contained in:
Alan Agius 2020-05-12 14:28:20 +02:00 committed by Kara Erickson
parent 466df41c8f
commit bbd556ee9f
2 changed files with 2 additions and 0 deletions

View File

@ -1,5 +1,6 @@
{
"compilerOptions": {
"importHelpers": true,
"experimentalDecorators": true,
"lib": [
"dom",

View File

@ -1,5 +1,6 @@
{
"compilerOptions": {
"importHelpers": true,
"lib": ["dom", "es2015"],
"types": ["angular"]
}