Commit 20dd1e1
Fix typescript with cjs compile issue (#802)
When I tried to run examples with some versions of typescript, some
versions(version< 5.3) failed to compile.
The main reason is line-bot-sdk-nodejs's compilerOption is wrong.
To provide dual package, we need to use `"module": "ESNext"` and
`"moduleResolution": "Bundler"`.
We used `NodeNext` but we should not because this repository will
support others not only Node.js.
Otherwise, TypeScript will explicitly write a resolution-mode to the
type definition files. (like `/// <reference types="node"
resolution-mode="require"/>`)
Although it should normally be written, there needs to be a way to turn
this off when supporting dual packages.
In addition, this change upgrades `target` from ES2018 to ES2022.
Node.js v18 supports ES2022.
ref: https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping
Co-authored-by: Tokuhiro Matsuno <[email protected]>1 parent ed3f213 commit 20dd1e1
File tree
6 files changed
+9
-9
lines changed- docs/getting-started
- examples
- echo-bot-ts-cjs
- echo-bot-ts-esm
6 files changed
+9
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | | - | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
0 commit comments