Files
nexe/src/patches/disable-node-cli.js
T
2017-06-26 20:01:53 -05:00

16 lines
357 B
JavaScript

export default async function disableNodeCli (compiler, next) {
if (compiler.options.enableNodeCli) {
return next()
}
const nodecc = await compiler.readFileAsync('src/node.cc')
const nodeccMarker = "argv[index][0] == '-'"
nodecc.contents = nodecc.contents.replace(
nodeccMarker,
nodeccMarker.replace('-', ']')
)
return next()
}