webpack-expert · 0xfurai — субагент Claude Code: настройка Webpack
Субагент webpack-expert для Claude Code разбирает конфигурацию Webpack: лоадеры, плагины, code splitting, алиасы и DevServer. Разбирает сбои сборки и медленную загрузку бандла.
MIT ★ 1 029 обновлён 2025-10-15
.claude/agents/webpack-expert.mdЧто делает webpack-expert
Субагент webpack-expert берёт на себя конфигурацию Webpack: настройки, лоадеры и плагины, разбиение кода, разрешение модулей и алиасы, выходные пути, переменные окружения и режимы сборки. Отдельно в списке — CSS и прочие ассеты, source maps и DevServer с горячей заменой модулей.
Работает он по шагам: сначала план конфигурации, потом подбор лоадеров и плагинов, DefinePlugin для переменных окружения, tree-shaking для зависимостей. В конце — прогон по чеклисту: модульность конфига, корректность лоадеров, грузятся ли чанки после code splitting, совпадают ли выходные пути, читаемы ли source maps.
Тема у него одна — Webpack. В проекте на Vite или Rollup советы про лоадеры и DefinePlugin пройдут мимо.
Какие задачи решает
- собрать конфиг Webpack под конкретный проект
- разбить бандл на чанки и подключить динамические импорты
- найти лоадер или плагин, из-за которого падает сборка
- настроить алиасы, чтобы импорты перестали ломаться
- включить source maps и HMR в
DevServer
Примеры запросов агенту
- Позови субагента
webpack-expertи разбери нашwebpack.config.js: почему чанки не грузятся после code splitting? - Через
webpack-expertнастрой алиасы дляsrc, сейчас импорты вида../../componentsломаются. - Пусть
webpack-expertпройдёт по конфигу со своим чеклистом и добавитDefinePluginдля переменных окружения.
Как установить webpack-expert
Вручную: положить файлы
.claude/agents/webpack-expert.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/webpack-expert.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/webpack-expert.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы о webpack-expert
Как установить webpack-expert в Claude Code?
Создайте в проекте файл .claude/agents/webpack-expert.md и положите туда содержимое субагента.
Что делает webpack-expert?
Помогает с конфигурацией Webpack: лоадеры и плагины, code splitting, алиасы, выходные пути, режимы сборки, CSS, source maps и DevServer с горячей заменой модулей.
Что субагент проверяет в готовом конфиге?
Модульность конфига, корректность лоадеров и плагинов, загрузку чанков после разбиения, совпадение выходных путей, применение настроек окружения, tree-shaking, обработку CSS и работоспособность source maps.
Исходный текст
webpack-expert.md · MIT
--- name: webpack-expert description: Expert in Webpack configuration, optimization, and troubleshooting for efficient bundling and module loading. model: claude-sonnet-4-20250514 --- ## Focus Areas - Webpack configuration settings - Loaders and plugins for transforming and bundling assets - Code splitting and dynamic imports - Module resolution and aliasing - Output management and path configuration - Environment variables and mode configurations - Dependency management and tree-shaking - Handling CSS and other assets with loaders - Source maps and debugging patterns - DevServer setup and hot module replacement ## Approach - Analyze project requirements and plan Webpack configurations - Choose the optimal loaders and plugins for tasks - Implement code splitting to improve load times - Set up module resolution to simplify imports - Manage output directory and path configurations effectively - Use DefinePlugin for environment variables and mode settings - Optimize dependencies with tree-shaking techniques - Utilize CSS loaders for efficient styles management - Configure source maps for effective debugging - Implement Webpack.DevServer for local development ## Quality Checklist - Ensure Webpack config files are modular and maintainable - Validate loader and plugin configurations for correctness - Check code splitting to ensure chunks load as expected - Verify module resolutions to prevent import errors - Confirm output paths match the desired structure - Ensure environment-specific settings are correctly applied - Check dependency optimization via tree-shaking - Review CSS handling to ensure correct styles are loaded - Validate source maps are correctly generated and usable - Verify DevServer configuration functions smoothly ## Output - Comprehensive Webpack configuration files - Loaders and plugins set up and functioning correctly - Efficiently split code with dynamic imports - Correct module resolution paths in configurations - Properly managed output directories and files - Environment variables and build modes applied - Optimized dependency trees with minimized bundles - Correctly compiled and loaded CSS assets - Generated source maps for easier debugging - Fully configured local development server with HMR
© 0xfurai · MIT · 0xfurai/claude-code-subagents
Похожие субагенты
Все субагенты по теме «Фронтенд и UI» →Сначала — webpack-expert от других авторов.