-
Notifications
You must be signed in to change notification settings - Fork 92
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: add new mixin loadCustomLoader in Loader #202
Conversation
a39dac1
to
acfca7e
Compare
太需要这个功能了!文档也得一起写上。 |
module.exports = { | ||
customLoader: { | ||
adapter: { | ||
directory: 'app/adapter', |
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.
还得支持 filter,例如过滤 _
开始的文件(如 _foo.js
不希望被加载)。
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.
支持的,直接传递 loader 那个 options 进去就好了
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.
所以需要文档。。。
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.
+1
const defaultConfig = { | ||
caseStyle: 'lower', | ||
initializer(Class) { | ||
return new Class(loader.app); |
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.
如果 load 的是 app/ultis 这种 exports 方式的,会不会有问题
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.
默认加载 class,其他的通过配置的方式。
文档也补充一下呗,其他 lgtm |
文档在这里 eggjs/egg#3484 |
+1 发吧 |
Co-Authored-By: popomore <[email protected]>
没问题我先发一版 |
<!-- Thank you for your pull request. Please review below requirements. Bug fixes and new features should include tests and possibly benchmarks. Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md 感谢您贡献代码。请确认下列 checklist 的完成情况。 Bug 修复和新功能必须包含测试,必要时请附上性能测试。 Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md --> ##### Checklist <!-- Remove items that do not apply. For completed items, change [ ] to [x]. --> - [x] `npm test` passes - [x] tests and/or benchmarks are included - [x] documentation is changed or added - [x] commit message follows commit guidelines ##### Affected core subsystem(s) <!-- Provide affected core subsystem(s). --> ##### Description of change <!-- Provide a description of the change below this comment. -->
Checklist
npm test
passesAffected core subsystem(s)
Description of change