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