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 partme-ai/full-stack-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
Provides per-component and per-API examples with cross-platform compatibility details for uni-app, covering built-in components, uni-ui components, and APIs (network, storage, device, UI, navigation, media). Use when the user needs official uni-app components or APIs, wants per-component examples with doc links, or needs platform compatibility checks.
tools
Creates new uni-app projects via the official CLI or HBuilderX with Vue 2/Vue 3 template selection, manifest.json and pages.json configuration, and directory structure setup. Use when the user wants to scaffold a new uni-app project, initialize project files with a single command, or set up the development environment.
tools
Browses, installs, configures, and manages plugins from the uni-app plugin market (ext.dcloud.net.cn) including component plugins, API plugins, and template plugins with dependency handling. Use when the user needs to find and install uni-app plugins, configure plugin settings, manage plugin dependencies, or integrate third-party components.
tools
Develops native Android and iOS plugins for uni-app including module creation, JavaScript-to-native communication, and plugin packaging for distribution. Use when the user needs to build custom native modules, extend uni-app with native capabilities (camera, Bluetooth, sensors), or create publishable native plugins.