library-bundler

Configure build systems to bundle and publish JavaScript/TypeScript component libraries.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/deve1993/Quickfy-website --skill library-bundler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: library-bundler
Source: https://github.com/deve1993/Quickfy-website/tree/main/.claude/skills/library-bundler
Command: npx skills add https://github.com/deve1993/Quickfy-website --skill library-bundler

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Configure build systems, optimize bundle size, manage multi-format exports for ESM/CJS/UMD, and publish packages to NPM with proper versioning.

Core Features & Use Cases

  • Build System Configuration: tsup, Vite, Rollup, esbuild, Webpack
  • Bundle Optimization: tree-shaking, code splitting, minification, compression, bundle size analysis
  • Multi-Format Support: ESM, CJS, UMD, IIFE, dual package exports
  • TypeScript Integration: .d.ts generation, type checking, path aliasing resolution
  • Publication Workflows: npm registry publishing, changelog generation, Git tagging, semver

Quick Start

Use this skill to configure a library build that outputs ESM/CJS bundles and prepares for npm publishing with proper versioning.

Frequently Asked Questions about library-bundler

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I bundle a JavaScript library for ESM, CJS, and UMD formats?

Bundle your library across multiple formats by configuring a build tool like tsup, Vite, or Rollup to output ESM, CJS, and UMD entry points. Define format-specific outputs in your build config, specify external dependencies to exclude, and generate corresponding type declarations for each format.

What's the best way to optimize bundle size and enable tree-shaking?

Tree-shaking removes unused code when you mark dependencies as external, use ES modules for your source, and configure your bundler to eliminate dead code during minification. Combine this with code splitting to separate concerns and analyze bundle size to identify optimization opportunities.

Can I publish a TypeScript library with type declarations to npm?

Yes. Configure your build to generate .d.ts type declaration files during bundling, include them in your npm package, and use package.json exports to point to both JavaScript and type files. Set up npm publishing workflows with versioning, changelog generation, and git tagging for production releases.

How do I configure dual package exports for ESM and CommonJS?

Define conditional exports in package.json using the exports field to route import and require requests to separate ESM and CJS bundles. Your bundler outputs both formats, and consumers automatically receive the correct module format based on their import syntax.

Does library bundling work for monorepos and scoped packages?

Yes. Configure build systems to handle monorepo structures and scoped package names (@org/package), manage internal dependencies as external, and publish multiple scoped packages to npm with individual versioning and changelog tracking.

What pre-publish checks should I run before releasing to npm?

Perform bundle-size analysis to catch regressions, verify type declarations are generated and valid, check that all external dependencies are correctly configured, run type checking on TypeScript sources, and validate the package structure before pushing git tags and publishing to the npm registry.