Webpack Config Builder skill for Claude and Codex
Writes one working webpack.config.js for a chosen target (web, node, or electron) and mode, with only the loaders you picked, correct resolve settings for…
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when you want one straightforward webpack.config.js for a specific mode and target such as node or electron, with just the loaders you picked. Do not use for a multi-environment config set with shared common rules, or understanding or repairing an existing config. Related topics: coding, webpack.
What it will ask you for
- Project language (choose one: JavaScript, TypeScript)
- Entry files (longer free text)
- Output directory (free text, e.g. "dist")
- Target environment (choose one: web, node, electron-main, electron-renderer)
- Loaders needed (choose any: Babel, TypeScript, CSS, Sass, Images and fonts, Assets as raw text)
- Mode (choose one: development, production)
- Enable source maps (choose one: Yes, No)
- Webpack version (choose one: 5, 4)
How it works
- Set target, externals, and output for the chosen environment; node and electron-main exclude node_modules from the bundle.
- Add one module rule per selected loader with the correct loader chain order and file test, using asset modules on webpack 5.
- Configure resolve.extensions and ts-loader only when TypeScript is chosen, pointing at the project tsconfig.
- Add the mode-specific block: devServer with hot reload and a fast devtool for development, minimizer and content hashes for production.
- Trim the file to constants, used plugin imports, and literal settings with no environment conditionals.
What you get
A single javascript code block containing the full webpack.config.js with imports, entry, output, target, module.rules, resolve, devtool, and the devServer or optimization block for the mode.
What it watches out for
- Bundling node_modules into a node or electron-main build, which breaks native modules and bloats the output.
- Using file-loader or url-loader on webpack 5 where asset modules replace them and the old loaders are unmaintained.
- Setting devtool to source-map in development, which makes every rebuild seconds slower than the eval variants.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.