wasp
wasp copied to clipboard
Fix how we build generated project for production (dev deps)
Summary:
- We have dependencies (things we need when running the code), and we have dev dependencies (things we need when writing the code, e.g., TypeScript).
- TypeScript is specified as a dev dependency (as it should be), meaning we shouldn't install it when building Wasp for production. The same goes for nodemon, @types packages, etc. One can usually avoid installing dev dependencies by running the command
npm install --production(this creates a "production build). - Wasp does not make this distinction, it always calls the same code which ends up calling the regular
npm install, regardless of the Wasp command at hand (start,build,compile, ...).
To make Wasp production ready, we must:
- Start treating dev dependencies differently than regular dependencies
- Put each dependency into the appropriate category (e.g. TypeScript is a dev dependency, Express is a regular dependency)
- Ensure our code can run without any dev dependencies (e.g., we currently don't compile TypeScript when building for production)
While we're at it, we should probably take care of #456 too.
Is this blocked by the restructuring, or can we go after it right now?
I'd say it's blocked.
@sodic is this now solved after 0.12.0?
I'm not sure, some parts of it may be fixed, but I think not (I think we still treat them the same way when building for production).
Most (if not all) points are still applicable, I'd say.