Skip to content

Commit 33d73ca

Browse files
committed
Tweak some headers build settings
1 parent 7da05b1 commit 33d73ca

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

packages/headers/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This is the changelog for [`headers`](https://github.com/mjackson/remix-the-web/
44

55
## v0.11.0 (2025-06-06)
66

7+
- Add `/src` to npm package, so "go to definition" goes to the actual source
78
- Use one set of types for all built files, instead of separate types for ESM and CJS
89
- Build using esbuild directly instead of tsup
910

packages/headers/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
},
1212
"homepage": "https://github.com/mjackson/remix-the-web/tree/main/packages/headers#readme",
1313
"files": [
14-
"dist",
15-
"src",
1614
"LICENSE",
17-
"README.md"
15+
"README.md",
16+
"dist",
17+
"src"
1818
],
1919
"type": "module",
20-
"main": "./dist/headers.cjs",
21-
"module": "./dist/headers.js",
2220
"types": "./dist/headers.d.ts",
21+
"module": "./dist/headers.js",
22+
"main": "./dist/headers.cjs",
2323
"exports": {
2424
".": {
2525
"types": "./dist/headers.d.ts",
@@ -34,11 +34,11 @@
3434
"esbuild": "^0.20.0"
3535
},
3636
"scripts": {
37-
"clean": "rm -rf dist",
3837
"build:types": "tsc --project tsconfig.build.json",
39-
"build:esm": "esbuild src/headers.ts --bundle --outfile=dist/headers.js --format=esm --platform=neutral --minify --sourcemap",
40-
"build:cjs": "esbuild src/headers.ts --bundle --outfile=dist/headers.cjs --format=cjs --platform=node --minify --sourcemap",
38+
"build:esm": "esbuild src/headers.ts --bundle --outfile=dist/headers.js --format=esm --platform=neutral --sourcemap",
39+
"build:cjs": "esbuild src/headers.ts --bundle --outfile=dist/headers.cjs --format=cjs --platform=node --sourcemap",
4140
"build": "pnpm run clean && pnpm run build:types && pnpm run build:esm && pnpm run build:cjs",
41+
"clean": "rm -rf dist",
4242
"test": "node --experimental-strip-types --disable-warning=ExperimentalWarning --test ./src/**/*.test.ts",
4343
"prepublishOnly": "pnpm run build"
4444
},

packages/headers/tsconfig.build.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"declarationMap": true,
77
"outDir": "./dist"
88
},
9-
"include": ["src"]
10-
}
9+
"include": ["src"],
10+
"exclude": ["src/**/*.test.ts"]
11+
}

0 commit comments

Comments
 (0)