Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[legacy-framework] (newapp) move dev dependencies to devDependencies in package.json (better for Docker) #2475

Merged
merged 1 commit into from
Jun 10, 2021

Conversation

kivi
Copy link

@kivi kivi commented Jun 10, 2021

What are the changes and their implications?

Prior to this commit devDependencies were moved to dependencies, in favor to fix issues with builds on some cloud server providers. But this results into a very large production container. If build as Docker image just the directory of node_modules is larger than 550MB.

There is significant reduction by moving following dependencies back to devDependencies

  • @types/preview-email
  • @types/react
  • eslint
  • husky
  • lint-staged
  • prettier-plugin-prisma
  • prettier
  • pretty-quick
  • preview-email
  • prisma
  • typescript"

Testing

git clone https://github.com/kivi/blitz-docker-example ./testBlitzDevdeps
cd .\testBlitzDevdeps
yarn

Build the image:

docker build . -t blitz-devdeps

check if image was build. Check size

docker images | grep blitz-devdeps

Test run and open in browser

docker run --name blitz-devdeps-running -p 3031:3000 blitz-devdeps

@flybayer
Copy link
Member

Thank you!!

@flybayer flybayer changed the title move dependencies to devDependencies (newapp) move dev dependencies to devDependencies in package.json (better for Docker) Jun 10, 2021
@flybayer flybayer merged commit ef6a6db into blitz-js:canary Jun 10, 2021
@blitzjs-bot
Copy link
Contributor

Added @kivi contributions for code

@itsdillon itsdillon changed the title (newapp) move dev dependencies to devDependencies in package.json (better for Docker) [legacy-framework] (newapp) move dev dependencies to devDependencies in package.json (better for Docker) Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants