diff --git a/.changeset/publish-sourcemaps.md b/.changeset/publish-sourcemaps.md new file mode 100644 index 0000000..1f22d13 --- /dev/null +++ b/.changeset/publish-sourcemaps.md @@ -0,0 +1,7 @@ +--- +"@formhaus/core": patch +"@formhaus/react": patch +"@formhaus/vue": patch +--- + +Source maps are now published alongside the minified bundles. When a form throws in a consumer's app, the stack trace points at the original source line in `src/`, not at a one-letter variable in the minified output. diff --git a/packages/core/tsup.config.ts b/packages/core/tsup.config.ts index aa4edcb..d0f8737 100644 --- a/packages/core/tsup.config.ts +++ b/packages/core/tsup.config.ts @@ -7,5 +7,6 @@ export default defineConfig({ clean: true, treeshake: true, minify: true, + sourcemap: true, target: 'es2020', }); diff --git a/packages/react/tsup.config.ts b/packages/react/tsup.config.ts index 96f57de..845afbd 100644 --- a/packages/react/tsup.config.ts +++ b/packages/react/tsup.config.ts @@ -7,6 +7,7 @@ export default defineConfig({ clean: true, treeshake: true, minify: true, + sourcemap: true, target: 'es2020', external: ['react', 'react-dom', '@formhaus/core'], }); diff --git a/packages/vue/vite.config.ts b/packages/vue/vite.config.ts index 22549b3..9a0ee7d 100644 --- a/packages/vue/vite.config.ts +++ b/packages/vue/vite.config.ts @@ -13,6 +13,7 @@ export default defineConfig({ }), ], build: { + sourcemap: true, lib: { entry: resolve(__dirname, 'src/index.ts'), formats: ['es'],