-
-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Update vue-cli mode documentation to show a mode other than production or development #985
Comments
When I use the --mode staging it does not build the full file with vendor.js and css, it seems to only build the .js file? Is this a bug? |
When --mode staging
When --mode production
|
@jnarowski See the start of this thread, just add a '.env.staging' file and add the NODE_ENV=production as the first line and then do |
Perfect, I guess I totally missed that. It worked! Thanks so much. |
I wonder if the docs should be updated to clarify that now? I do see that it specifies this (adding NODE_ENV) in the .env.[environment] files but I totally missed it. |
This has been added to the docs, thank you! |
Hmm, I'm wondering if the example of setting the BASE_URL on this page should also be updated: https://cli.vuejs.org/config/#baseurl Because if the only way to trigger a slimmed down "production" build is by setting the NODE_ENV=production, it makes relying on the NODE_ENV to inform the app about which environment you're in useless. Instead, it seems like the example here should instead rely on using the modes, and setting the different base_urls in an environment variable in the corresponding .env.[mode] file and using that variable to set the
|
What problem does this feature solve?
Increases comprehension on what the --mode feature can be used for and how it might be used, specifically that you can override the NODE_ENV variable to produce a production build with alternate config (ie. staging)
Refer to https://forum.vuejs.org/t/how-to-build-production-app-with-varying-config/29708/3
What does the proposed API look like?
In both cases, the app is built as a production app because of the NODE_ENV, but in the staging equivalent the process.env.VUE_APP_TITLE variable is overrided
The text was updated successfully, but these errors were encountered: