@foxglove/tsconfig 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -6
- package/base.json +0 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -18,9 +18,13 @@ yarn add -D @foxglove/tsconfig
|
|
|
18
18
|
|
|
19
19
|
Choose the config that matches your environment:
|
|
20
20
|
|
|
21
|
-
### Node.js applications and libraries
|
|
21
|
+
### Node.js applications and published libraries
|
|
22
22
|
|
|
23
|
-
Uses `module: "NodeNext"
|
|
23
|
+
Uses `module: "NodeNext"`, which enforces Node.js ESM rules.
|
|
24
|
+
|
|
25
|
+
Use `node.json` for published libraries, even if your library will be used in bundled apps. Bundlers consume Node-style packages natively, just remember to avoid Node-specific APIs like `fs` or `process`.
|
|
26
|
+
|
|
27
|
+
Relative imports must include explicit file extensions (e.g., `import { foo } from "./bar.ts"`).
|
|
24
28
|
|
|
25
29
|
```json
|
|
26
30
|
{
|
|
@@ -33,13 +37,14 @@ Uses `module: "NodeNext"` which enforces Node.js ESM rules, where imports must i
|
|
|
33
37
|
}
|
|
34
38
|
```
|
|
35
39
|
|
|
36
|
-
>
|
|
40
|
+
> [!TIP]
|
|
41
|
+
> `base.json` uses `target: "ESNext"`. For published libraries, you may wish to set a lower target (e.g., `"ES2022"` for Node 18).
|
|
37
42
|
|
|
38
|
-
|
|
43
|
+
### Bundled applications (Webpack, Vite, esbuild, etc)
|
|
39
44
|
|
|
40
|
-
|
|
45
|
+
Uses `module: "Preserve"`, which enables optimizations for code consumed directly by a bundler.
|
|
41
46
|
|
|
42
|
-
|
|
47
|
+
Supports extensionless relative imports (e.g., `import { foo } from "./bar"`).
|
|
43
48
|
|
|
44
49
|
```json
|
|
45
50
|
{
|
package/base.json
CHANGED