spiegel-keyman/common/web/tslib
2023-06-15 10:56:44 +07:00
..
src chore(web): relocates tslib-treeshaker def, consolidates it further 2023-06-15 10:56:44 +07:00
build.sh chore(common/web): cleanup per PR review 2023-06-09 08:11:20 +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.