You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CLAUDE.md
+14-16Lines changed: 14 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,29 +94,27 @@ npm run clean # Clean artifacts
94
94
95
95
**Important:** After modifying TypeScript source files, run `tsc --build` (or `npm run tsc`) to compile the changes before running tests. Tests execute the compiled JavaScript in `dist/`, not the TypeScript source directly.
96
96
97
-
### Package Build Structure
97
+
### Building a Single Package
98
98
99
-
Each package has a dual build output:
99
+
To build a specific package (e.g., `@deepkit/bson`) from the repo root:
**CRITICAL:** Each package's `npm run build` script creates a `dist/esm/package.json` with `{"type": "module"}` to enable ES modules. If you delete `dist/` manually, you MUST run `npm run build` in that package to recreate this file, otherwise ES module imports will fail.
106
+
The order matters:
107
+
1.`tsc --build` compiles TypeScript and creates the `dist/` directories
108
+
2.`npm run build` creates `dist/esm/package.json` for ES module support
105
109
106
-
```bash
107
-
# If you deleted dist/ in a package, run:
108
-
cd packages/<package-name>&& npm run build
110
+
### Package Build Structure
109
111
110
-
# Or rebuild everything:
111
-
npm run build
112
-
```
112
+
Each package has a dual build output:
113
113
114
-
**When rebuilding a single package:** Always build both tsconfig files:
-`dist/esm/` - ES Modules build (from `tsconfig.esm.json`)
115
116
116
-
```bash
117
-
npm run tsc -- --build packages/core/tsconfig.json packages/core/tsconfig.esm.json
118
-
cd packages/core && npm run build # Creates dist/esm/package.json
119
-
```
117
+
**CRITICAL:** The `npm run build` script in each package creates `dist/esm/package.json` with `{"type": "module"}`. This file is required for ES module imports to work. If you delete `dist/` manually, you MUST run `npm run build` to recreate it.
0 commit comments