refactor: generalize nodeArgs
This commit is contained in:
parent
1ade8294a1
commit
976969683f
|
@ -8,13 +8,9 @@ export default {
|
|||
*/
|
||||
hot: false,
|
||||
/**
|
||||
* Whether the Node.js inspector is enabled.
|
||||
* Arguments to pass along to node. See: https://nodejs.org/api/cli.html
|
||||
*/
|
||||
inspect: false,
|
||||
/**
|
||||
* Whether Node.js profiling is enabled.
|
||||
*/
|
||||
profile: false,
|
||||
nodeArgs: [],
|
||||
/**
|
||||
* Whether to start the server after building.
|
||||
*/
|
||||
|
|
|
@ -14,8 +14,7 @@ const {
|
|||
module.exports = async (flecks) => {
|
||||
const {
|
||||
hot,
|
||||
inspect,
|
||||
profile,
|
||||
nodeArgs,
|
||||
start: isStarting,
|
||||
} = flecks.get('@flecks/server');
|
||||
|
||||
|
@ -79,14 +78,8 @@ module.exports = async (flecks) => {
|
|||
options.keyboard = false;
|
||||
// HMR.
|
||||
options.signal = !!hot;
|
||||
// Debugging.
|
||||
if (inspect) {
|
||||
options.nodeArgs.push('--inspect');
|
||||
}
|
||||
// Profiling.
|
||||
if (profile) {
|
||||
options.nodeArgs.push('--prof');
|
||||
}
|
||||
// Node args.
|
||||
options.nodeArgs.push(...nodeArgs);
|
||||
// Bail hard on unhandled rejections and report.
|
||||
options.nodeArgs.push('--unhandled-rejections=strict');
|
||||
options.nodeArgs.push('--trace-uncaught');
|
||||
|
|
Loading…
Reference in New Issue
Block a user