vue-cli should support different NODE_ENV config for Webpack and Vue app
See original GitHub issueWhat problem does this feature solve?
I want to see warn logs of components on production build. Almost all warn()
calls surrounded with if (NODE_ENV !== 'production') { }
.
What does the proposed API look like?
In vue.config.js
{
...,
appEnv: "different",
...
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Modes and Environment Variables - Vue CLI
When running vue-cli-service , environment variables are loaded from all corresponding files. If they don't contain a NODE_ENV variable, it will ...
Read more >Using Modes and Environment Variables in Vue.js - Medium
With NODE_ENV set to "test" for example, Vue CLI creates a webpack config that is intended to be used and optimized for unit...
Read more >Using Environment Variables with Vue.js - Stack Overflow
If you use vue cli with the Webpack template (default config), you can create and add your environment variables to a .env file....
Read more >Custom Build Modes with Vue CLI 3 | Rangle.io
The webpack build mode is controlled by an environment variable called NODE_ENV and changes how the app is built - for instance, whether...
Read more >How To Use Environment Variables in Vue.js - DigitalOcean
By default, Vue CLI will support three modes: “development”, "test', and “production”. For more information on using environment variables ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ouzman This is the official solution. https://cli.vuejs.org/guide/mode-and-env.html#modes
I solved this problem.
In
vue.config.js
: