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

入口文件appjs不支持配置 #5255

Closed
cwjTerrace opened this issue Jan 6, 2020 · 8 comments
Closed

入口文件appjs不支持配置 #5255

cwjTerrace opened this issue Jan 6, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request

Comments

@cwjTerrace
Copy link

问题描述

项目入口文件app不支持配置,如需要动态配置入口文件app2.jsx或app3.jsx

复现步骤

    const sourceDirName = projectConfig.sourceRoot || config_1.default.SOURCE_DIR;
    const outputDirName = projectConfig.outputRoot || config_1.default.OUTPUT_DIR;
    const sourceDir = path.join(appPath, sourceDirName);
    const outputDir = path.join(appPath, outputDirName);
    const entryFilePath = util_1.resolveScriptPath(path.join(sourceDir, config_1.default.ENTRY));

期望行为

helper.js中新增一行代码

const sourceDirName = projectConfig.sourceRoot || config_1.default.SOURCE_DIR;
    const outputDirName = projectConfig.outputRoot || config_1.default.OUTPUT_DIR;
    **const entryDirName=projectConfig.entryRoot || config_1.default.ENTRY;**
    const sourceDir = path.join(appPath, sourceDirName);
    const outputDir = path.join(appPath, outputDirName);
    const entryFilePath = util_1.resolveScriptPath(path.join(sourceDir, entryDirName));

报错信息

系统信息

补充信息

如果您有功能上的建议,可以提到 FeatHub

使用上的问题,欢迎在「Taro 社区」一起交流

@taro-bot
Copy link

taro-bot bot commented Jan 6, 2020

CC @luckyadam

@taro-bot
Copy link

taro-bot bot commented Jan 6, 2020

欢迎提交 Issue~

如果你提交的是 bug 报告,请务必遵循 Issue 模板的规范,尽量用简洁的语言描述你的问题,最好能提供一个稳定简单的复现。🙏🙏🙏

如果你的信息提供过于模糊或不足,或者已经其他 issue 已经存在相关内容,你的 issue 有可能会被关闭。

Good luck and happy coding~

@luckyadam luckyadam added the enhancement New feature or request label Jan 7, 2020
@luckyadam
Copy link
Member

luckyadam commented Jan 7, 2020

暂不支持,如果需要不同的入口文件,也可以在一个入口文件中写不同逻辑判断吧

@cwjTerrace
Copy link
Author

不行,微信小程序的app文件中config无法使用动态传入,微信那边编译不通过

@tourze
Copy link
Contributor

tourze commented Jan 7, 2020

这个特性希望得到支持~

@luyukunluyukun
Copy link

@luckyadam 请问大佬2.0编译后根目录下的runtime.js和vendor.js对小程序运行有影响吗,我编译后小程序无法预览了

@cwjTerrace
Copy link
Author

暂不支持,如果需要不同的入口文件,也可以在一个入口文件中写不同逻辑判断吧

这个有希望支持吗

@Chen-jj
Copy link
Contributor

Chen-jj commented Jul 10, 2020

暂时不会考虑支持,赞同“在一个入口文件中写不同逻辑”

@Chen-jj Chen-jj closed this as completed Jul 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants