We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
功能需求是这样的。往往开发、QA测试、线上环境接口配置是不一样的。每次手动切换非常麻烦而且上线时容易遗忘切换成环境。希望可以通过添加edp build的参数,打包使用不同的配置文件。例如:
// 将开发时配置文件打包 edp build --dev // 将QA联调配置文件打包 edp build --qa // 将生产环境配置文件打包 edp build --prod
解决方案大约是这样: 首先 假设在src下放置一个conf文件夹;其中按环境划分子文件夹
src/conf src/conf/dev src/conf/prod src/conf/qa
其次 在require.config里对配置文件设定一个path;在源码中,是指定到conf/dev/config.js
require.config({ basrUrl: 'src', paths: { conf: 'conf/dev' } });
然后 在打包前,先将conf的path修改成参数指定的值,例如edp build --prod
require.config({ basrUrl: 'xxx', paths: { conf: 'conf/prod' } });
最后 正常继续其他打包工作
这样,在源码中使用require('config/some-config')不变。
require('config/some-config')
The text was updated successfully, but these errors were encountered:
我先搬家了,通过Milestone来管理issue. ecomfe/edp#171
Sorry, something went wrong.
No branches or pull requests
功能需求是这样的。往往开发、QA测试、线上环境接口配置是不一样的。每次手动切换非常麻烦而且上线时容易遗忘切换成环境。希望可以通过添加edp build的参数,打包使用不同的配置文件。例如:
解决方案大约是这样:
首先 假设在src下放置一个conf文件夹;其中按环境划分子文件夹
其次 在require.config里对配置文件设定一个path;在源码中,是指定到conf/dev/config.js
然后 在打包前,先将conf的path修改成参数指定的值,例如edp build --prod
最后 正常继续其他打包工作
这样,在源码中使用
require('config/some-config')
不变。The text was updated successfully, but these errors were encountered: