Skip to content

feat(vite): source maps for library build, optimizeDeps for peer packages, disable minification for library output #371

Description

@k-deejah

Problem

1. vite.config.ts has no source map configuration for the library build — consumers who debug the library in their devtools see minified code with no source maps. Adding build.sourcemap: true would make library debugging significantly easier.

2. vite.config.ts has no optimizeDeps configurationsorokit-core and @creit.tech/stellar-wallets-kit are large ESM packages that Vite pre-bundles every cold start. Explicitly listing them in optimizeDeps.include reduces cold-start time in consumer projects.

3. vite.config.ts does not set build.minify to false for the library build — minification of a library makes debugging harder and increases the chance of variable name collisions in consumers' bundles. Library builds should prefer minify: false (or "esbuild" with keepNames: true).

Solution

  1. Add build.sourcemap: true to the library config.
  2. Add optimizeDeps: { include: ["sorokit-core", "@creit.tech/stellar-wallets-kit"] }.
  3. Set build.minify: false for the library output format.

Acceptance Criteria

  • dist/sorokit-ui.es.js.map is generated after npm run build
  • Consumer projects pre-bundle sorokit-core without errors
  • Library output is unminified (readable variable names)
  • npm run build passes

Note for Contributors: Write a clear PR description. Show the dist/ directory listing with source maps and confirm the output is readable.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions