@@ -23,6 +23,9 @@ This module contains the standard Check Digit Typescript configuration, along wi
2323to be used when publishing a package to NPM, or to bundle a package for deployment. It uses ` tsc ` for generating
2424types, and ` esbuild ` for generating code.
2525
26+ ** Note:** if building an ESM bundle, the ` require ` function will be defined as a global variable, to allow
27+ dynamic ` require ` s by CommonJS submodules. This is not a problem for NodeJS, but will cause issues in a browser environment.
28+
2629#### Options
2730
2831- ` --type ` the type of output to generate. Defaults to ` module ` (ESM). Valid values are ` commonjs ` , ` module ` or ` types ` .
@@ -72,7 +75,8 @@ the new version of Typescript, and/or without emitting warnings during these tes
7275
7376Strict semver is a little complicated, as Typescript itself does not adhere to semver. So our "best effort" policy is:
7477
75- - Each update to the minimum Node target (e.g. Node 16 to Node 18) will result in a new major version of this module.
78+ - Each update to the minimum Node target (e.g. Node 18 to Node 20), or a change to a major compiler output option
79+ (e.g. ` module ` , ` target ` or ` moduleResolution ` ) will result in a new major version of this module.
7680 We coordinate this with whatever the latest LTS version of Node is currently supported by Amazon Lambda, Google Cloud Functions
7781 and Azure Functions.
7882- Each new "major" version of Typescript (e.g. ` 4.2.x ` to ` 4.3.x ` ) will result in a new minor version of this module.
@@ -96,18 +100,14 @@ Make sure your project's `tsconfig.json` extends `@checkdigit/typescript-config`
96100
97101```
98102{
99- "extends": "@checkdigit/typescript-config",
100- "compilerOptions": {
101- "rootDir": "src",
102- "outDir": "build"
103- },
104- "exclude": [
105- "node_modules",
106- "build"
107- ]
103+ "extends": "@checkdigit/typescript-config"
108104}
109105```
110106
107+ Note this configuration has ` moduleResolution ` set to ` bundler ` . This requires that you use the ` builder ` command
108+ to produce working code for deployment. However, for simply running Jest tests, this is not necessary if
109+ used in conjunction with [ ` @checkdigit/jest-config ` ] ( https://github.com/checkdigit/jest-config ) .
110+
111111## License
112112
113113MIT
0 commit comments