Skip to content

Commit 1be49af

Browse files
GnorTechrogerwang
authored andcommitted
support node-main
1 parent 1f8fc20 commit 1be49af

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

lib/internal/bootstrap_node.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@
6262
global.process.mainModule = module;
6363
module._compile('global.module = module;\n' +
6464
'global.require = global.__nw_require = require;\n', 'nw-emulate-node');
65+
if (process.argv[1]) {
66+
var path = NativeModule.require('path');
67+
process.argv[1] = path.resolve(process.argv[1]);
68+
preloadModules();
69+
Module.runMain();
70+
}
6571
return;
6672
}
6773
// There are various modes that Node can run in. The most common two

0 commit comments

Comments
 (0)