This template serves as a starting point for JavaScript libraries targeting both Node and the Browser and implemented in TypeScript.
Once you clone this template, you can build the package with the following commands:
npm install
npm run build
Run tests via:
npm test
The overall build pipeline looks like the following:
- TypeScript builds all source files under
./src
to ECMAScript Modules (ESM) under./dist-esm
- Rollup builds
./dist-esm
to an optimized single file at./dist/index.js
as the Node entry point. - Rollup builds
./dist-esm
to an optimized browser bundle under./browser/index.js
.
Tests follow a similar pipeline, however output folders have the test-
prefix.