-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
feat: 让微信小程序可以自定义project.config.json文件的源文件名 #7745
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
用户可以通过在config/index.js、config/dev.js或者其它配置文件里面添加projectConfigName: "project1.config.json" 来指定project.config.json的源文件. 可以用于在不同的编译目标里指定不同的appid,实现一份代码同时编译成多个不同appid的小程序,上传给不同的商家使用。 使用场景不限于上面描述的。 目前该改动只支持微信小程序, 未对其它程序类型做支持。 该改动兼容老的逻辑,无副作用。
lexmin0412
approved these changes
Sep 29, 2020
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
牛逼
牛气。 |
请问这个特性合并了吗 |
不如增加一个 读取当前环境变量的PROJECT_NAME 的功能 这样更加灵活 |
说的没错。 主要考虑是把值写进配置文件方便管理,不用去记那么多环境变量,只要知道当前用的配置文件是否对就可以了。并且,可以无缝切换到其它小程序的配置。用环境变量的话换一个目标平台就得多设置一个环境变量,最后就膨胀了。 |
这个好merge吗? 我对这个功能还挺依赖的,因为我做的一个模版app好上好几家的架,需要指定不同的project文件来定义不同的appid. |
luckyadam
approved these changes
Dec 2, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
用户可以通过在config/index.js、config/dev.js或者其它配置文件里面添加projectConfigName: "project1.config.json"
来指定project.config.json的源文件.
可以用于在不同的编译目标里指定不同的appid,实现一份代码同时编译成多个不同appid的小程序,上传给不同的商家使用。
使用场景不限于上面描述的。
目前该改动只支持微信小程序, 未对其它程序类型做支持。
该改动兼容老的逻辑,无副作用。
这个 PR 做了什么? (简要描述所做更改)
weapp.ts在拷贝project.config.json文件时检查项目配置里面是否有projectConfigName,如果有,则拷贝projectConfigName指向的文件,没有则拷贝默认的project.config.json文件。
这个 PR 是什么类型? (至少选择一个)
这个 PR 满足以下需求:
这个 PR 涉及以下平台:
其它需要 Reviewer 或社区知晓的内容:
该功能在微信群8讨论过,没有收到异议。