-
Notifications
You must be signed in to change notification settings - Fork 37
feat: support eggScriptsConfig in package.json #41
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
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,13 @@ class Command extends BaseCommand { | |
if (pkgInfo && pkgInfo.egg && pkgInfo.egg.typescript) { | ||
argv.sourcemap = true; | ||
} | ||
|
||
// read argv from eggScriptsConfig in package.json | ||
if (pkgInfo && pkgInfo.eggScriptsConfig && typeof pkgInfo.eggScriptsConfig === 'object') { | ||
for (const key in pkgInfo.eggScriptsConfig) { | ||
if (argv[key] == null) argv[key] = pkgInfo.eggScriptsConfig[key]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 结合 https://github.com/node-modules/common-bin/blob/master/lib/helper.js#L180
目前不支持,提了个 PR:#54 |
||
} | ||
} | ||
} | ||
|
||
// execArgv | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict'; | ||
|
||
const sleep = require('mz-modules/sleep'); | ||
|
||
module.exports = app => { | ||
if (process.env.ERROR) { | ||
app.logger.error(new Error(process.env.ERROR)); | ||
} | ||
|
||
app.beforeStart(function* () { | ||
yield sleep(process.env.WAIT_TIME); | ||
}); | ||
}; |
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', | ||
}; |
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,15 @@ | ||
{ | ||
"name": "example", | ||
"version": "1.0.0", | ||
"dependencies": { | ||
"egg": "^1.0.0" | ||
}, | ||
"egg": { | ||
"framework": "custom-framework" | ||
}, | ||
"eggScriptsConfig": { | ||
"ignore-stderr": true, | ||
"daemon": true, | ||
"workers": 1 | ||
} | ||
} |
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.
是否改成 config 节点下比较好?
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.
现在有 egg, eggPlugin 等一系列配置了,还是先平铺吧?