-
-
Notifications
You must be signed in to change notification settings - Fork 1.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: support customLoader #3484
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3484 +/- ##
==========================================
+ Coverage 99.67% 99.67% +<.01%
==========================================
Files 32 32
Lines 922 923 +1
==========================================
+ Hits 919 920 +1
Misses 3 3
Continue to review full report at Codecov.
|
再看看 |
docs/source/en/advanced/loader.md
Outdated
// the property name when load to application, E.X. app.controller | ||
controller: { | ||
// relative to app.config.baseDir | ||
directory: 'app/controller', |
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.
logger 那个是全路径的,是不是也可以支持下相对路径。
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.
这个是相对代码的,而 logger 不知道会在什么目录
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.
我想表达的是,logger 那里应该支持配置相对路径,然后我们判断是相对的,自动 join 上 appInfo.root,这样就不会写死了,也不用写 fn 格式的 config 了,简单很多。
而且修改 root 的话,就可以统一修改 custom logger 的所有文件路径了
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.
原来我之前已经实现了,eggjs/egg-logger#41
放到 egg-core 吧,Midway 好像是基于 egg-core 的,不是 egg |
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
docs/source/en/advanced/loader.md
Outdated
|
||
```js | ||
// app.js | ||
// This is only the example below, please use 'loadController' instead |
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.
或者把示例改为加载 app/utils
,避免误导
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
#3480
Checklist
npm test
passesAffected core subsystem(s)
Description of change