ResponsiveVoice imported from npm as an ESM module, bundled by Vite. This is a developer recipe — clone the examples repo and run locally to try it.
git clone https://github.com/ResponsiveVoice/examples.git
npm installnpm run vite:devbrowser/vite/src/main.ts — uncomment the
apiKey field in rv.init({ ... }) and paste your key
For a production bundle:
npm run vite:build && npm run vite:preview.
basic example, but it imports
@responsivevoice/core from npm via
import { getResponsiveVoice } from '@responsivevoice/core' in
src/main.ts — no CDN script tag, no IIFE global. Vite bundles the
TypeScript entry for the browser.