This project is a template to create a typescript utility library based on Vinodh Kumar tutorial.
This template is configured to use:
Feature | Technology used |
---|---|
Package manager | PNPM |
Package bundler | Vite |
Programming language | Typescript |
Basic linting | ESLint |
Code formatting | Prettier |
Linting only staged files | lint-staged |
-
Install
node>=18.16.1
etpnpm
globally. -
Create a repo from this template and execute :
cd repo/ pnpm install
-
Change package name and version everywhere
// in package.json { "name": "xxxxx", "version": "x.x.x", ... "main": "./dist/xxxxx.umd.cjs", "module": "./dist/xxxxx.js", "exports": { ".": { "import": "./dist/xxxxx.js", "require": "./dist/xxxxx.umd.cjs" } }, }
// in vite.config.js export default defineConfig({ ... name: "xxxxx", // will be export under this name in umd fileName: "xxxxx", // the name of the file to export ... });