Skip to content

Modernization 3/4: Move build tooling to Rollup #1386

@Ryang-21

Description

@Ryang-21

Part of the js-stellar-sdk modernization epic.

Depends on: Task 2 (ESM compliance).

Goal

Replace the Webpack/Babel pipeline with Rollup.

Scope

  • Add Rollup configuration producing ESM (dist/esm/), CJS (dist/cjs/), and browser UMD/IIFE (dist/browser/) outputs with sourcemaps.
  • Wire up @rollup/plugin-typescript (or rollup-plugin-esbuild) for TS compilation, @rollup/plugin-node-resolve, @rollup/plugin-commonjs for any remaining CJS deps, and @rollup/plugin-terser for minified browser bundles.
  • Emit .d.ts rollups via rollup-plugin-dts so published types mirror published JS.
  • Update package.json exports, main, module, browser, and types fields to point at Rollup outputs.
  • Remove config/webpack.config.browser.js, babel.config.js, and associated dependencies once Rollup replaces them.
  • Update scripts/ and package.json build, build:browser, and prepublish scripts.

Acceptance

  • yarn build runs Rollup end-to-end and produces the full dist/ tree.
  • Bundle size (gzipped) is equal to or smaller than the pre-migration Webpack output.
  • npm pack tarball contents match the current published shape; a smoke test install in a scratch Node ESM project and a scratch Vite project succeeds.

Risks

  • Rollup tree-shaking behaves differently than Webpack; baseline and compare gzipped sizes before merging.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Backlog (Not Ready)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions