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

配置不同环境的自动更新地址 #129

Open
chf-gh opened this issue Sep 27, 2024 · 1 comment
Open

配置不同环境的自动更新地址 #129

chf-gh opened this issue Sep 27, 2024 · 1 comment

Comments

@chf-gh
Copy link

chf-gh commented Sep 27, 2024

现在有测试环境和生产环境,在config.default.js 中配置 自动更新url,现在通过 cros-env 设置NODE_ENV=test/prod,判断环境变量来设置更新url,但是打包后打印日志发现项目启动时 main.js中获取该变量为undefined,程序启动后可以获取到变量但是全部都是prod。我看项目中有config.local.js和config.prod.js ,我应该怎么增加一个config.test.js,然后项目打包时使用config.test.js配置?

@a395027720
Copy link

我目前也有这个需求,我用的这个地址的第二种方案实现的,https://juejin.cn/post/7397288730690519103

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants