I recently migrate a small exercice project from CRA to Vite, and it use Docker, however since Vite is installed as Dev dependency, and i am running npm run install --omit=dev so it may explain why I am getting this error :
> #12 0.726 > npm run build --prefix client
> #12 0.726
> #12 1.193
> #12 1.193 > project@2.0.0 build
> #12 1.193 > vite build --emptyOutDir
> #12 1.193
> #12 1.199 sh: vite: not found
So is there a way to only install Vite and omit all the rest dependency which is not needed on the production, or I have to install normally with all the packages with npm run install by default ? The Docker file is as follow :
FROM node:lts-alpine
WORKDIR /app
COPY package*.json ./
COPY client/package*.json client/
RUN npm run install-client --omit=dev
COPY server/package*.json server/
RUN npm run install-server --omit=dev
COPY client/ client/
RUN npm run build
COPY server/ server/
USER node
CMD [ "npm", "start", "--prefix", "server" ]
EXPOSE 8000