Skip to content

Commit 7ff0dde

Browse files
committed
chore: make installed package smaller
1 parent 25b9261 commit 7ff0dde

3 files changed

Lines changed: 31 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,21 @@
33
All notable changes to this project are documented here. This project follows
44
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
55

6+
## 1.0.1 — 2026-08-13
7+
8+
Packaging only. No source, API or behaviour changes — upgrading from 1.0.0 is
9+
safe and requires nothing.
10+
11+
### Changed
12+
13+
- **The installed package is about 40% smaller.** Sourcemaps no longer inline the
14+
original TypeScript via `sourcesContent`, which had made them roughly 62% of
15+
the unpacked size. Stack traces still resolve to the original file and line;
16+
only stepping through source needs the repository, which is public.
17+
- **The UMD build no longer ships a sourcemap.** It is the minified `<script>`
18+
bundle for CDN use and its map was the single largest file in the package. The
19+
ESM and CJS builds that real projects import still ship theirs.
20+
621
## 1.0.0 — 2026-08-13
722

823
First stable release, and a rewrite. The 0.1.x line kept the JWT in a

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@thinkgrid/react-starter-auth",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"description": "Secure JWT authentication for React and Next.js — HttpOnly server sessions, verified tokens, CSRF built in.",
55
"keywords": [
66
"react",

rollup.config.mjs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ const licenseBanner = license({
3636
},
3737
});
3838

39+
/**
40+
* Sourcemaps without the embedded original source.
41+
*
42+
* `sourcesContent` inlines every `.ts` file into the maps, which made them ~62%
43+
* of the installed package. Stack traces still resolve to the original file and
44+
* line; only the "view source" step needs the repository, which is public.
45+
*/
46+
const sourcemapExcludeSources = true;
47+
3948
export default [
4049
// ESM + CJS. Declarations are emitted here only, from tsconfig.build.json,
4150
// which excludes __tests__ so test typings stay out of the tarball.
@@ -46,13 +55,15 @@ export default [
4655
dir: './dist',
4756
format: 'esm',
4857
sourcemap: true,
58+
sourcemapExcludeSources,
4959
entryFileNames: '[name].mjs',
5060
chunkFileNames: 'shared/[name]-[hash].mjs',
5161
},
5262
{
5363
dir: './dist',
5464
format: 'cjs',
5565
sourcemap: true,
66+
sourcemapExcludeSources,
5667
exports: 'named',
5768
entryFileNames: '[name].cjs',
5869
chunkFileNames: 'shared/[name]-[hash].cjs',
@@ -75,7 +86,10 @@ export default [
7586
file: './dist/index.umd.js',
7687
format: 'umd',
7788
name: 'ReactStarterAuth',
78-
sourcemap: true,
89+
// No map for the UMD build: it is the minified <script> bundle for CDN
90+
// use, and its map was the single largest file in the package. The ESM
91+
// and CJS builds that real projects import still ship theirs.
92+
sourcemap: false,
7993
exports: 'named',
8094
globals,
8195
},

0 commit comments

Comments
 (0)