spiegel-keyman/common/web/tslib
Marc Durdin cd8121ef65 chore(common): builder scripts now use /resources/build/builder.inc.sh
Note: there is a bit of potential confusion about the difference between
/resources/builder.inc.sh (the full implementation for builder scripts),
and /resources/build/builder.inc.sh (the source script that builder
scripts should always use).

This allows us to make assumptions that will always be true for builder
scripts that may not be true for other scripts, such as setting base
folder.
2024-05-02 15:54:31 +07:00
..
src chore(web): relocates tslib-treeshaker def, consolidates it further 2023-06-15 10:56:44 +07:00
build.sh chore(common): builder scripts now use /resources/build/builder.inc.sh 2024-05-02 15:54:31 +07:00
package.json chore(common/web): cleanup per PR review 2023-06-09 08:11:20 +07:00
README.md chore(web): KMW use of importHelpers 2023-06-08 13:03:25 +07:00
tsconfig.json chore(web): kmw-main tsconfig -> /web, redirect in /common/web 2023-06-14 08:22:05 +07:00

The default import setup for the tslib package is unfortunately incompatible with esbuild when in ES5 mode. But... with a little elbow grease, we can fix that with this package by importing its ES5-compatible file and exporting it as this package's default export for use in anything looking to "importHelpers".

To utilize this with esbuild while enabling the "importHelpers" compilation option in your tsconfig.json, you'll want to set the following in your esbuild config:

  alias: {
    'tslib': '@keymanapp/tslib'
  },

Note that esbuild 0.15.16 is the minimum required version to utilize the 'alias' feature necessary to replace tslib for tsc-generated import { /* */ } from 'tslib' statements that result from enabling "importHelpers" in a tsconfig.