process.env undefined Vue 问题:自己定义的env变量命名有问题。 官方文档是这么说的: Note that only variables that start with VUE_APP_ will be statically embedded into the client bundle with webpack.DefinePlugin. 所以,定义变量的时候,需要以***VUE_APP_***开头。 如: VUE_APP_SECRET=secret