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
Risks
- Rollup tree-shaking behaves differently than Webpack; baseline and compare gzipped sizes before merging.
Part of the js-stellar-sdk modernization epic.
Depends on: Task 2 (ESM compliance).
Goal
Replace the Webpack/Babel pipeline with Rollup.
Scope
dist/esm/), CJS (dist/cjs/), and browser UMD/IIFE (dist/browser/) outputs with sourcemaps.@rollup/plugin-typescript(orrollup-plugin-esbuild) for TS compilation,@rollup/plugin-node-resolve,@rollup/plugin-commonjsfor any remaining CJS deps, and@rollup/plugin-terserfor minified browser bundles..d.tsrollups viarollup-plugin-dtsso published types mirror published JS.package.jsonexports,main,module,browser, andtypesfields to point at Rollup outputs.config/webpack.config.browser.js,babel.config.js, and associated dependencies once Rollup replaces them.scripts/andpackage.jsonbuild,build:browser, andprepublishscripts.Acceptance
yarn buildruns Rollup end-to-end and produces the fulldist/tree.npm packtarball contents match the current published shape; a smoke test install in a scratch Node ESM project and a scratch Vite project succeeds.Risks