-
Notifications
You must be signed in to change notification settings - Fork 37
feat: support pkgInfo.eggScriptsConfig.require #47
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
Conversation
Waiting for #48 revert. |
Codecov Report
@@ Coverage Diff @@
## master #47 +/- ##
==========================================
+ Coverage 99.15% 99.60% +0.44%
==========================================
Files 6 6
Lines 237 252 +15
Branches 46 50 +4
==========================================
+ Hits 235 251 +16
+ Misses 2 1 -1
Continue to review full report at Codecov.
|
lib/command.js
Outdated
} | ||
|
||
// read `egg.require` from package.json | ||
if (argv.require && Array.isArray(argv.require)) { |
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.
这段是不是该放在 for 前面,不然 pkgInfo 的 require 和 --require 会覆盖?我们应该是需要合并。
} | ||
} | ||
|
||
delete argv.require; |
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.
argv.require 有哪里插入到 execArgvObj.require 了么?(不确定 common-bin 里面的逻辑是否执行了)
下面那个单测,多加个 --require 验证下是否合并了。
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.
这边,这样顺便也解决了 --require 只能传递全路径的易用性(并且兼容以前的全路径传递),两边合并下作为 execObject 传递逻辑上清晰一些
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.
Checklist
npm test
passesAffected core subsystem(s)
Description of change
support:
The current
pkgInfo.eggScriptConfig.require
need to provide full path, this pr aims to support relative path & npm pkg.