spiegel-keyman/common/web/tslib
2023-06-09 08:11:20 +07:00
..
src fix(web): noticed an extra dep or two among the helpers 2023-06-08 15:51:08 +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 refactor(web): extracts treeshaker into tslib helper-project 2023-06-08 14:09:18 +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.