microbundle-ts-pkg
microbundle-ts-pkg copied to clipboard
A TypeScript npm package skeleton/starter project with microbundle, node:test and prettier
microbundle-ts-pkg: A TypeScript npm package skeleton/starter project with microbundle, node:test and prettier
Comes with:
- SAMPLE_README.md and USE_CASES.md for documentation.
- built-in
node:testrunner for testing (see ./tests) - prettier for formatting
- microbundle for compiling TypeScript to UMD, ESM, CJS
Requirements
- Node 18 (to run this repository, due to
node:testusage) - npm v7+
Setup
- Clone the repository
- Run
npm installinstalls all required dependencies. - Run
npm run buildto build from TypeScript to common JavaScript distribution formats. - Run
npm testto run all tests.
npm scripts
npm run testrun tests against built output with Node.js' nativenode:testmodule. Important: runs against build output so runnpm run buildbeforehand.npm run buildrun build from TypeScript to UMD, CJS, ESM with microbundlenpm run watchruns build in watch mode with microbundlenpm run lintwill ensure all of the files are prettier-formattednpm run formatwill run prettier formatting option on all the examples files (and tests).npm run release, run clean, production build and release withnp.
About
This package is maintained by Hugo from Code with Hugo and Alpine.js Weekly.
Acknowledgments
Special thanks to:
- The developers behind
LICENSE
Code is licensed under the MIT License.