webpack-plugin-recipes
БесплатноБез исполняемых скриптовНе проверенUse whenever you face a webpack-build problem that ends with needing to write a plugin — 26 production-shaped recipes covering bundle-size budgets, forbidden…
от pproenca★ 231 звезда на GitHubОб этом скилле
dot-skills Webpack 5 Plugins Best Practices
Cookbook of 26 production-shaped webpack 5 plugins, organized by the problem they solve. Each recipe starts with a clearly defined problem statement ("here's what hurts without this"), shows the naive non-plugin approach, then provides a complete working plugin (60-150 lines) with explanation, variations, and "when NOT to use" guidance.
Companion to webpack-plugin-authoring — authoring teaches how to write any plugin correctly; recipes teach which plugin to write for a specific pain point. Recipes cross-reference the authoring rules they apply.
When to Apply
Reference these recipes whenever:
- A team has a recurring build-time problem that "feels like it should be a plugin" (architecture rules, secret leak prevention, asset organization)
- You need to integrate webpack output with downstream systems (SSR servers, CDNs, monitoring)
- You're considering whether to write your own plugin OR adopt an existing one — these recipes show the underlying pattern so you can judge fit
- Migrating from another bundler and need to recreate framework-style features (filesystem routing, virtual modules)
- Onboarding new engineers to webpack plugin authoring — recipes give realistic, end-to-end examples
Recipe Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Build-time Guardrails | CRITICAL | guard- |
| 2 | Build Metadata & Manifests | HIGH | meta- |
| 3 | Virtual Modules & Codegen | HIGH | virtual- |
| 4 | Code Transformation | MEDIUM-HIGH | transform- |
| 5 | Developer Experience | MEDIUM | dx- |
| 6 | Asset Pipeline | MEDIUM | assets- |
Quick Reference
1. Build-time Guardrails (CRITICAL)
guard-bundle-budget— Fail builds when initial JS exceeds a per-entry gzipped budgetguard-forbidden-imports— Fail builds when forbidden imports cross architectural boundariesguard-required-env-vars— Fail builds when required environment variables are missingguard-no-secrets-bundled— Fail builds when secret-shaped strings leak into client bundles
2. Build Metadata & Manifests (HIGH)
meta-inject-build-info— Inject__COMMIT__/__BUILD_TIME__into source via DefinePlugin + emitbuild-info.jsonmeta-asset-manifest— Emit chunk-grouped manifest mapping logical names → hashed filenamesmeta-license-notice— GenerateLICENSES.txtby walking the module graph (notnode_modules/)meta-sri-manifest— Compute SHA-384 SRI hashes per asset for CSP compliance
3. Virtual Modules & Codegen (HIGH)
virtual-module-from-memory— Resolvevirtual:Ximports to in-memory strings (Vite-style)virtual-routes-from-filesystem— Generate route map frompages/directory (Next.js-style)virtual-barrel-from-directory— Auto-generate barrel re-exports from a directoryvirtual-types-from-runtime— Emit.d.tsfrom runtime data (config files, JSON schemas)
4. Code Transformation (MEDIUM-HIGH)
transform-replace-library— Replacereactwithpreact/compatat resolve (with subpath handling)transform-strip-debug-helpers— StripdevAssert()/devLog()calls + dev-only imports from productiontransform-conditional-polyfill— Inject only the polyfills target browsers actually need (browserslist + core-js-compat)transform-banner-with-dynamic-content— Per-chunk banners with current year, version, git committransform-define-from-config— DriveDefinePluginsubstitutions from aflags/staging.json-style file
5. Developer Experience (MEDIUM)
dx-build-duration-report— Persist build durations, warn when current build is >30% slower than mediandx-notify-on-done— Desktop notification (local) + Slack webhook (CI) on build completedx-diff-changed-chunks— Print only the chunks that actually changed between rebuildsdx-open-browser-on-first-build— Open the dev-server URL AFTER first successful build (not before)
6. Asset Pipeline (MEDIUM)
- [
assets-pre-compress-gzip-brotli](reference
Установить webpack-plugin-recipes в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл webpack-plugin-recipes?
Use whenever you face a webpack-build problem that ends with needing to write a plugin — 26 production-shaped recipes covering bundle-size budgets, forbidden architectural imports, env-var validation, secret-leak prevention, build-info injection, asset manifests, license walking, SRI hashes, virtual modules (Vite-style), filesystem routing (Next.js-style), generated barrels, runtime-driven TS types, library replacement (react→preact), debug-stripping, conditional polyfills, dynamic banners, feature flags, build-duration regression tracking, desktop/Slack notifications, changed-chunks diffing, browser auto-open, gzip/brotli pre-compression, image optimization, type-based dist layout, empty-chunk cleanup, cache-busting query strings. Each recipe is a complete working plugin drawn from production patterns at Next.js, Storybook, webpack-contrib. Trigger when the user asks how to do X with webpack or whether a plugin exists for X. Companion to webpack-plugin-authoring.
Как установить скилл webpack-plugin-recipes?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл webpack-plugin-recipes запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic