compiler-explorer: [BUG]: Build system broken for production instances

Describe the bug

Previously we ran make dist during a docker build, then make run when running the image.

As of #3269 make dist is gone. I tried instead using make prereqs then make run, but dist and run used to imply a production node env, so that no longer works, it gets us a dev instance instead which we do not want in our production. I then tried the same with NODE_ENV=production, but run tries to run webpack, which requires dev dependencies. As a result I have to run prereqs with a dev env and then run run with a production one, which is silly. Moreover, a plain make run (not messing with prereqs) on its own won’t work out of the box with NODE_ENV=production any more for the same reason.

I also am not a fan of webpack being run at run time. I would like to be able to do that up-front like used to happen, as that is a build step. The only reason it’s done at run time is to make dev setups less likely to have stale data, but that is not applicable to us, we start from a clean tree on every build.

I would therefore like two things:

  1. All dependencies needed for NODE_ENV=production make run to be present in packages.json, not some of them erroneously in devDependencies.
  2. A way (I don’t mind if I have to manually specify an extra make option or use a special target) to run webpack at build time and not at run time.

Steps to reproduce

N/A

Expected behavior

N/A

Reproduction link

Not applicable

Screenshots

Not applicable

Operating System

No response

Browser version

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (21 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks; it’s non-critical now as I do have the workaround described in the bug report working, just documented with an XXX to move setting NODE_ENV back to before the make prereqs, pointing at this issue