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

Vue production build #217

Open
mayakeeley opened this issue Aug 21, 2023 · 3 comments
Open

Vue production build #217

mayakeeley opened this issue Aug 21, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@mayakeeley
Copy link
Member

When setting up a vue production app without a staging app we run into the following issue:

vue-cli-service: not found

Vue CLI Service is and is meant to be a dev dependency from what I can tell, but with npm_config_production set to true in production, this causes the frontend app to not build.

I'm assuming that we haven't run into this bug before (as far as I'm aware) because we typically set up staging first and then production and we promote to production which doesn't require a rebuild of the frontend app.

However, I'm labelling this as an issue because we should be able to deploy our apps just for production as needed. My current workaround has been to just set npm_config_production=false in production which is not ideal.

A couple of approaches I tried:

  1. Setting vue-cli-service as a dependency. Caused a chain of other packages to need to be dependencies and we really don't want them to beSetting vue-cli-service as a dependency. Caused a chain of other packages to need to be dependencies and we really don't want them to be
  2. Removing the build command in package.json. Caused (unsurprisingly perhaps) the frontend to just not build/not build in the right folder. Not sure which one yet. Needs looking into further. I feel like removing the vue-cli-service dependency for the build would be the solution here
@mayakeeley mayakeeley added the bug Something isn't working label Aug 21, 2023
@whusterj
Copy link
Member

When we've looked at this before, we've concluded that setting NPM_CONFIG_PRODUCTION=false is safe in the prod environment. This enables Heroku to install devDependencies, but will still create a 'production' build, because NODE_ENV is set to 'production'.

https://thinknimble.slack.com/archives/G03GBBRC3/p1637266147072900?thread_ts=1637259568.071700&cid=G03GBBRC3

@oudeismetis
Copy link
Member

Before closing this I'd like to take a minute to understand the issue (or the symptom of a possible issue we are seeing).
Safety aside, we'd want to avoid the production build being bulkier than it needs to be (especially if we are install dev dependencies like Cypress...which is large)

@lakardion
Copy link
Member

Does our migration to vite make a difference (or solve) this issue ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants