The starter is built on top of Vite 5.x and prepared for writing libraries in TypeScript. It generates a package with support for ESM modules and IIFE.
MIT License
The starter is built on top of Vite 5.x and prepared for writing libraries in TypeScript. It generates a package with support for ESM modules and IIFE.
This is a template repo. Click the green Use this template button to get started.
If you prefer to do it manually with the cleaner git history
git clone https://github.com/kbysiec/vite-vanilla-ts-lib-starter.git
cd vite-vanilla-ts-lib-starter
npm i
When you use this template, update the following:
.git
directory and run git init
to clean up the historypackage.json
- it will be the name of the IIFE bundle global variable and bundle files name (.cjs
, .mjs
, .iife.js
, d.ts
)LICENSE
README
and CHANGELOG
filesAnd, enjoy :)
The starter contains the following scripts:
dev
- starts dev serverbuild
- generates the following bundles: ESM (.js
) and IIFE (.iife.js
). The name of bundle is automatically taken from package.json
name propertytest
- starts vitest and runs all teststest:coverage
- starts vitest and run all tests with code coverage reportlint:scripts
- lint .ts
files with eslintlint:styles
- lint .css
and .scss
files with stylelintformat:scripts
- format .ts
, .html
and .json
files with prettierformat:styles
- format .cs
and .scss
files with stylelintformat
- format all with prettier and stylelintprepare
- script for setting up husky pre-commit hookuninstall-husky
- script for removing husky from repositoryIf you found it useful somehow, I would be grateful if you could leave a star in the project's GitHub repository.
Thank you.