@@ -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+
3948export 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