-
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
Changes from all commits
aeba4cf
b45b759
e21bba3
9f3bcf6
124673a
3b49af1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
'use strict'; | ||
|
||
exports.keys = '123456'; | ||
|
||
exports.logger = { | ||
level: 'WARN', | ||
consoleLevel: 'WARN', | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
atian25 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// enable plugins | ||
|
||
/** | ||
* app global Error Handling | ||
* @member {Object} Plugin#onerror | ||
* @property {Boolean} enable - `true` by default | ||
*/ | ||
onerror: { | ||
enable: false, | ||
package: 'egg-onerror', | ||
path: 'xxxxx', | ||
}, | ||
|
||
/** | ||
* session | ||
* @member {Object} Plugin#session | ||
* @property {Boolean} enable - `true` by default | ||
* @since 1.0.0 | ||
*/ | ||
session: { | ||
enable: false, | ||
package: 'egg-session', | ||
path: 'xxxxx', | ||
}, | ||
|
||
/** | ||
* i18n | ||
* @member {Object} Plugin#i18n | ||
* @property {Boolean} enable - `true` by default | ||
* @since 1.0.0 | ||
*/ | ||
i18n: { | ||
enable: false, | ||
package: 'egg-i18n', | ||
path: 'xxxxx', | ||
}, | ||
|
||
/** | ||
* file and dir watcher | ||
* @member {Object} Plugin#watcher | ||
* @property {Boolean} enable - `true` by default | ||
* @since 1.0.0 | ||
*/ | ||
watcher: { | ||
enable: false, | ||
package: 'egg-watcher', | ||
path: 'xxxxx', | ||
}, | ||
|
||
/** | ||
* multipart | ||
* @member {Object} Plugin#multipart | ||
* @property {Boolean} enable - `true` by default | ||
* @since 1.0.0 | ||
*/ | ||
multipart: { | ||
enable: false, | ||
package: 'egg-multipart', | ||
path: 'xxxxx', | ||
}, | ||
|
||
/** | ||
* security middlewares and extends | ||
* @member {Object} Plugin#security | ||
* @property {Boolean} enable - `true` by default | ||
* @since 1.0.0 | ||
*/ | ||
security: { | ||
enable: false, | ||
package: 'egg-security', | ||
path: 'xxxxx', | ||
}, | ||
|
||
/** | ||
* local development helper | ||
* @member {Object} Plugin#development | ||
* @property {Boolean} enable - `true` by default | ||
* @since 1.0.0 | ||
*/ | ||
development: { | ||
enable: false, | ||
package: 'egg-development', | ||
path: 'xxxxx', | ||
}, | ||
|
||
/** | ||
* logger file rotator | ||
* @member {Object} Plugin#logrotator | ||
* @property {Boolean} enable - `true` by default | ||
* @since 1.0.0 | ||
*/ | ||
logrotator: { | ||
enable: false, | ||
package: 'egg-logrotator', | ||
path: 'xxxxx', | ||
}, | ||
|
||
/** | ||
* schedule tasks | ||
* @member {Object} Plugin#schedule | ||
* @property {Boolean} enable - `true` by default | ||
* @since 2.7.0 | ||
*/ | ||
schedule: { | ||
enable: false, | ||
package: 'egg-schedule', | ||
path: 'xxxxx', | ||
}, | ||
|
||
/** | ||
* `app/public` dir static serve | ||
* @member {Object} Plugin#static | ||
* @property {Boolean} enable - `true` by default | ||
* @since 1.0.0 | ||
*/ | ||
static: { | ||
enable: false, | ||
package: 'egg-static', | ||
path: 'xxxxx', | ||
}, | ||
|
||
/** | ||
* jsonp support for egg | ||
* @member {Function} Plugin#jsonp | ||
* @property {Boolean} enable - `true` by default | ||
* @since 1.0.0 | ||
*/ | ||
jsonp: { | ||
enable: false, | ||
package: 'egg-jsonp', | ||
path: 'xxxxx', | ||
}, | ||
|
||
/** | ||
* view plugin | ||
* @member {Function} Plugin#view | ||
* @property {Boolean} enable - `true` by default | ||
* @since 1.0.0 | ||
*/ | ||
view: { | ||
enable: false, | ||
package: 'egg-view', | ||
path: 'xxxxx', | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
|
||
console.log('@@@ inject relative js by pkgInfo'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
|
||
console.log('@@@ inject by cli'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "example", | ||
"version": "1.0.0", | ||
"egg": { | ||
"framework": "custom-framework" | ||
}, | ||
"eggScriptsConfig": { | ||
"require": [ | ||
"./inject.js", | ||
"inject" | ||
] | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.
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.
https://github.com/eggjs/egg-scripts/pull/47/files/9f3bcf624beb545d40e1b1e6c39251f93e964f7c#diff-d8db36db6bfb32591336006f1dc1adee9e2caf7b021469995aa687c5c5723d0cR61-R64
这边,这样顺便也解决了 --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.
https://github.com/eggjs/egg-scripts/pull/47/files#diff-cd3896294facbcd40ebed616bbfdb8076c3f4cecb233872dde55add3cab4d57fR48
补了一个
--require=./inject2
的单测