-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
There are some quirks when working with Polymer 2 and typescript, especially when using it to develop separately shareable components and not applications. I think it would be good to collect some knowledge on how this is done.
My current workflow consists of:
- Write .ts files, compile them to .js and include the .js file in a script tag in my .html file. Unfortunately that results
- I use typescript namespaces, as modules are not supported at runtime by polymer tooling
- I use the "noEmitHelpers" option in my tsconfig to prevent small helper functions popping up in every .js file. I then include tslib (https://github.com/Microsoft/tslib) globally. If we were using modules, we could have used the "importHelpers" which is the most documented configuration. This does not work with namespaces however, and it will still emit the helper functions. Eventually I found the "noEmitHelpers" option but it is not very well documented.
All in all it's a bit cumbersome, so I'm wondering if there are better workflows.
keithstric
Metadata
Metadata
Assignees
Labels
No labels