Remix CLI required for remix build
, but only available in @remix-run/dev
#9775
Labels
remix build
, but only available in @remix-run/dev
#9775
Reproduction
Remix recommends placing
@remix-run/dev
indevDependencies
, so it's not bundled in the server.When building Remix in a Dockerfile, we normally prune out development dependencies before building the app. When using Turborepo in a monorepo, this is accomplished by the
turbo prune
command.However, once the app is pruned, we lose access to devDependencies. As a result, the remix CLI is no longer available, and we can't run
remix vite:build
. The current temporary solution is to put@remix-run/dev
into productiondependencies
, but that's not recommended by the Remix team.Note that this doesn't only happen with Docker; it's just much more evident with Docker because we prune the repo before building. This bug will occur with any build process that removes
devDependencies
before runningremix vite:build
.Dockerfile:
This issue was reported in #1233, but was closed without fixing it.
I think this can be fixed if we included the remix CLI in one of the other packages, like
@remix-run/node
or@remix-run/serve
.System Info
Used Package Manager
npm
Expected Behavior
The build should succeed.
Actual Behavior
Running
npm run build
which runsremix vite:build
fails with the following error:sh: 1: remix: not found
The text was updated successfully, but these errors were encountered: