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
举例有以下目录结构, 通过artus scanner的envs配置在不同环境开关启用不同插件时, 发现其他插件虽然未启用, 但是对应目录下的文件依旧会被import, 引发一些冲突问题.
The text was updated successfully, but these errors were encountered:
这是因为 Scanner 的设计目前遵循 构建 - 运行两个阶段的逻辑:
manifest.json
ARTUS_SERVER_ENV
而同时因为基于装饰器的类定义模型,目前只能通过 require 实体的方式才能确定对应类的作用;
综上,目前的设计中需要保证插件及其内部类,在 require/import 阶段没有副作用,将依赖运行环境的代码放进类或方法中,通过 Lifecycle / IoC 等框架机制来管理和运行。
Sorry, something went wrong.
构建阶段我可以理解. 不过我目前遇到的问题是, 运行时阶段看起来只要在config目录下声明了的插件, 不管是否被启用(enable), 都会被import, 感觉不太合理
运行时阶段是通过 app.load 加载生成好的 manifest,这个过程不会加载未启用的插件才对,只有 scan 才会出现全 import,而 scan 方法预期是在构建环境调的那个时候还没有 ENV
No branches or pull requests
举例有以下目录结构, 通过artus scanner的envs配置在不同环境开关启用不同插件时, 发现其他插件虽然未启用, 但是对应目录下的文件依旧会被import, 引发一些冲突问题.
The text was updated successfully, but these errors were encountered: