skills/build-skills/rollup/SKILL.md
Provides comprehensive guidance for Rollup bundler including configuration, plugins, code splitting, tree shaking, and multi-format library bundling. Use when the user asks about Rollup, needs to bundle JavaScript libraries, optimize output with tree shaking, or configure ESM/CJS builds.
npx skillsauth add teachingai/agent-skills rollupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use this skill whenever the user wants to:
rollup.config.js with input, output, and pluginsrollup -c to generate bundlesmain, module, and exports in package.json// rollup.config.js
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import terser from '@rollup/plugin-terser';
export default {
input: 'src/index.js',
output: [
{
file: 'dist/index.cjs.js',
format: 'cjs',
sourcemap: true,
},
{
file: 'dist/index.esm.js',
format: 'es',
sourcemap: true,
},
],
external: ['react', 'react-dom'], // Don't bundle peer deps
plugins: [
resolve(),
commonjs(),
terser(), // Minify for production
],
};
# Build
npx rollup -c
# Watch mode for development
npx rollup -c --watch
// package.json — library distribution fields
{
"main": "dist/index.cjs.js",
"module": "dist/index.esm.js",
"exports": {
".": {
"import": "./dist/index.esm.js",
"require": "./dist/index.cjs.js"
}
},
"files": ["dist"],
"sideEffects": false
}
// Dynamic imports create separate chunks
export default {
input: 'src/index.js',
output: {
dir: 'dist',
format: 'es',
chunkFileNames: 'chunks/[name]-[hash].js',
},
plugins: [resolve(), commonjs()],
};
external to avoid bundling themsideEffects: false in package.json to enable maximum tree shakingimport() for on-demand loadingrollup, bundler, ESM, CJS, tree-shaking, code splitting, library bundling, plugins
development
Guidance for Next.js using the official docs at nextjs.org/docs. Use when the user needs Next.js concepts, configuration, routing, data fetching, or API reference details.
tools
Provides comprehensive guidance for Flask framework including routing, templates, forms, database integration, extensions, and deployment. Use when the user asks about Flask, needs to create web applications, implement routes, or build Python web services.
development
Provides comprehensive guidance for FastAPI framework including routing, request validation, dependency injection, async operations, OpenAPI documentation, and database integration. Use when the user asks about FastAPI, needs to create REST APIs, or build high-performance Python web services.
development
Provides comprehensive guidance for Django framework including models, views, templates, forms, admin, REST framework, and deployment. Use when the user asks about Django, needs to create web applications, implement models and views, or build Django REST APIs.