1👍
I don’t know much about your project, but process.env.NODE_ENV
is a server side environment variable, and Vue is a client side application, so it will not have access to that.
You would have to pass that environment variable to your client somehow. If you are using webpack
, you could use the DefinePlugin
feature:
https://webpack.js.org/plugins/define-plugin/
This will allow you to define a global variable which you could then access inside of Vue.
- [Vuejs]-Visual Studio Code: Cannot find module – app.vue
- [Vuejs]-How to put JavaScript in Laravel make:auth
Source:stackexchange.com