A starter repo for creating libraries for browsers using TypeScript and Rollup.
To start, click the Use Template button on Github (or download the zip file and run git init). Then clone the repo and install dependencies with npm install.
To create a new library, change the name, description, author, copyright notice, license and other properties in package.json, LICENSE and README.
Create source files in src and export them in index.ts.
To test the library, make tests/examples in examples and include them in index.html. Examples should access the builds from ../dist and not the source files from the src directory.
To use the library locally, make a new project and include it in the package.json dependencies using file:./../../path/to/this/repo.
When pushing to Github on the master or main branch, the docs will be build using Github actions and pushed to Github pages. For this, Github pages must be enabled in the Github repository settings.
Build for development (Build and watch):
npm run devTo serve the local build and examples, run
npm run serveBuild for production (Build):
npm run buildBuild docs
npm run docsView docs locally
npm run serve-docsPublish to npm
npm run new:publishGenerate a packed .tgz
npm run new:packGenerate a new version
npm versionMIT
Generated with rollup-library-starter