Menu

Alpine didn't break your Vite build. A missing optional dependency did.
πŸ“°

Alpine didn't break your Vite build. A missing optional dependency did.

DEV Community: nodeΒ·MiiiΒ·about 22 hours ago
#e2nGCbNX
#devtonodejs#devto#dev#rollup#alpine
Long article (957 words) β€” no AI summary yet.
Reading 0:00
15s threshold

Alpine didn't break your Vite build. A missing optional dependency did.

The advice is everywhere in Docker threads: if a Node build fails on Alpine, switch to Debian.

I tested that claim against a real Vite 7 / React 19 / Tailwind 4 app. Alpine was innocent.

The test

Same source, four setups, one question: does the build produce a working bundle?

Setup node_modules/@rollup Build

node:22-alpine , npm install rollup-linux-x64-musl βœ… passes

node:22-alpine , npm ci with a lockfile generated on Debian rollup-linux-x64-gnu , rollup-linux-x64-musl βœ… passes

node:22-alpine , npm install --omit=optional (empty) ❌ fails immediately

node:22-bookworm-slim , npm ci rollup-linux-x64-gnu , rollup-linux-x64-musl βœ… passes

A clean install on musl builds a React app without complaint. So the base image is not the variable. The variable is whether Rollup's native parser got installed .

Why the parser is a package

Rollup 4 parses JavaScript with a native binary, not with JavaScript.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.