Examples

Copy-and-paste starter projects for common library setups with Packem

Examples

Each example is a complete, working project you can use as a starting point. Pick the one closest to what you are building.

Library starters

ExampleWhat it builds
Basic TypeScript LibraryA simple utility package with ESM output and .d.ts declarations
Dual Package (ESM + CJS)A library that ships both ESM and CJS for maximum compatibility
React Component LibraryReact components with CSS Modules, Server Components, and Storybook
MonorepoMultiple packages in a single workspace with shared configuration

Configuration recipes

ExampleWhat it covers
Extra ConditionsCustom export conditions in package.json validation

Advanced

ExampleWhat it covers
Minify HTML LiteralsAutomatically minify HTML and CSS inside template literals
require-cjs-transformerTransform ESM imports of CJS packages for better runtime performance

Quick start

Copy one of these to bootstrap a new project:

# TypeScript library
npx degit visulima/packem/examples/basic-library my-lib
cd my-lib && npm install && npm run build

# React component library
npx degit visulima/packem/examples/react-library my-components
cd my-components && npm install && npm run build
Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues