16 lines
357 B
JavaScript
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()
|
|
}
|