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

前端【yudao-ui-admin-vue2】无法修改NODE_ENV为production #556

Closed
980961628 opened this issue Jun 12, 2024 · 1 comment
Closed

前端【yudao-ui-admin-vue2】无法修改NODE_ENV为production #556

980961628 opened this issue Jun 12, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@980961628
Copy link

碰到问题,请在 https://github.com/YunaiV/ruoyi-vue-pro/issues 搜索是否存在相似的 issue。

不按照模板提交的 issue,会被系统自动删除。

基本信息

  • ruoyi-vue-pro 版本:yudao-ui-admin-vue2
  • 操作系统:window11
  • 数据库:

你猜测可能的原因

项目打包上线后,发现 process.env.NODE_ENV 一直为development,
我花费了一整天各种测试,始终无法修改成功。
vue_cli官网中说在.env文件中配置 NODE_ENV = production即可,但是yudao-ui-admin-vue2的.env文件中是这样配置的:ENV = production,所以打包后环境变量并没有修改成功,我试过把ENV改成NODE_ENV,结果项目运行不了。
请问ruoyi为什么要将NODE_ENV改成ENV去设置?如何才能将环境变量改成production?

image
image

复现步骤

在mian.js打印process.env.NODE_ENV,打包上线后,始终输出的是development

报错信息

没有报错信息

@YunaiV
Copy link
Owner

YunaiV commented Jun 15, 2024

保持和 ruoyi-vue 一致兼容,所以这块用了 ENV

@YunaiV YunaiV self-assigned this Jun 15, 2024
@YunaiV YunaiV added the question Further information is requested label Jun 15, 2024
@YunaiV YunaiV closed this as completed Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants