gulp-to-vitelisted
Install: claude install-skill JMAILLY/claude-migration-skills
# Gulp → Vite migration skill (Dockerized Drupal theme)
Migrate a Drupal theme front build from **Gulp** to **Vite**,
iso-functional and low-risk. Reference implementations: `Project D` (Tailwind) and
`Project B` (SASS + classic jQuery scripts — the case this skill is tuned for).
## Golden rule: everything goes through the container
The project is Dockerized + Makefile-driven. Run the build inside the `node`
service, never on the host — the host arch (esp. Apple Silicon/macOS) makes the
legacy `imagemin-*` native binaries fail with `ENOEXEC`, which is **not** a code
bug. The migrated build uses `sharp` (prebuilt musl/arm64 binaries), which does
not have this problem.
| Need | Command |
|---|---|
| Install deps | `make npm-install` (or `make npm c='install'`) |
| Dev server (watch + HMR) | `make npm-dev` |
| Production build | `make npm-build` |
| One-off verify build | `docker run --rm -v "$(pwd)":/var/www/html -w /var/www/html node:<LTS>-alpine sh -c 'rm -rf node_modules && npm install && npm run build'` |
## Step 0 — Feasibility verdict (say this out loud first)
For a classic GM theme, **Vite's headline features (bundling, tree-shaking,
per-module HMR) buy almost nothing.** Check why before promising speed:
- Theme JS is usually **classic jQuery/`Drupal.behaviors` IIFEs** (no
`import`/`export`). Gulp just terser-copies them 1:1. → grep the JS source; if
there are zero `import`/`export`, do **not** bundle — copy files.
- Vendor libs (swiper, fancybox, owl, masonry