So I want to ignore dev dependency in my dockerfile by adding the RUN npm ci --only=production. However, when the build is ran, it's looking for some of the packages that were listed in my devDependencies in package.json file.
Turns out there are bunch of packages required by webpack.config file. See error below.
Why is it doing this when they are dev packages? Should I be moving these packages to dependencies instead? (When I move them the error goes away but surely that can't be the right thing to do)
This is what the section of my dockerfile looks like:
COPY package*.json .npmrc ./
RUN npm ci --only=production
COPY . .
RUN NODE_ENV=production npm run build