$ recombobulate _
home / tips / ask-claude-to-migrate-your-webpack-config-to-vite
0

Ask Claude to Migrate Your Webpack Config to Vite

bagwaa @bagwaa · Mar 26, 2026 · Workflows
ask-claude-to-migrate-your-webpack-config-to-vite

Migrating from Webpack to Vite involves more than renaming config keys — entry points, aliases, environment variable handling, and custom loaders all need translation. Claude can do the heavy lifting.

Convert this webpack.config.js to a Vite config. The project is a 
React TypeScript app. Note anything without a direct Vite equivalent 
and suggest how to handle it.

[paste your webpack.config.js here]

Claude will produce a vite.config.ts with the correct plugins (@vitejs/plugin-react, vite-tsconfig-paths), translated resolve.alias entries, and a mapped define block for environment variables. For custom Webpack loaders — like raw-loader or @svgr/webpack — it will suggest the equivalent Vite plugin or a minimal inline workaround.

It'll also flag the things Vite handles differently from Webpack:

// Webpack: process.env.REACT_APP_API_URL
// Vite:    import.meta.env.VITE_API_URL
// Claude will tell you to update your source files too

Claude explains which .env variable prefix changes are required across your source files, so you don't end up with silent undefined values after the migration.

Follow up with "write a vitest.config.ts that reuses the same aliases" to complete the toolchain switch in one go.

Webpack-to-Vite migrations are tedious but mechanical — exactly the kind of task Claude excels at.

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
0
Scan Pending Changes for Security Issues with /security-review

The /security-review command scans your uncommitted changes for injection vectors, auth gaps, hardcoded secrets, and other common vulnerabilities.

bagwaa @bagwaa · 2 hours ago
0
Run Setup Scripts on Every Session with the SessionStart Hook

The SessionStart hook fires when any session begins or resumes, making it ideal for loading environment variables and running one-time setup scripts.

bagwaa @bagwaa · 2 hours ago
0
Write Property-Based Tests with fast-check and Claude

Ask Claude to write property-based tests for your functions using fast-check — it identifies the mathematical invariants in your code and generates tests that cover inputs you'd never enumerate by hand.

bagwaa @bagwaa · 2 hours ago