如何在没有内部模块的情况下构建node.js?

如何在没有内部模块的情况下构建node.js?,node.js,gyp,chakracore,Node.js,Gyp,Chakracore,我想构建一个特定的nodejs作为一个静态库,而不需要一些内部模块,比如child\u processdns等等 是否有一种可配置的方法来执行此操作?删除不需要的模块,从lib文件夹中删除.js文件,从lib/internal/module.js中的内置libs数组中删除它们,然后构建它 { 'variables': { 'v8_use_snapshot%': 'false', 'v8_trace_maps%': 0, 'node_use_dtrace%': 'fal

我想构建一个特定的nodejs作为一个静态库,而不需要一些内部模块,比如
child\u process
dns
等等


是否有一种可配置的方法来执行此操作?

删除不需要的模块,从
lib
文件夹中删除.js文件,从
lib/internal/module.js
中的
内置libs
数组中删除它们,然后构建它

{
  'variables': {
    'v8_use_snapshot%': 'false',
    'v8_trace_maps%': 0,
    'node_use_dtrace%': 'false',
    'node_use_lttng%': 'false',
    'node_use_etw%': 'false',
    'node_use_perfctr%': 'false',
    'node_no_browser_globals%': 'false',
    'node_use_v8_platform%': 'true',
    'node_use_bundled_v8%': 'true',
    'node_shared%': 'false',
    'force_dynamic_crt%': 0,
    'node_module_version%': '',
    'node_shared_zlib%': 'false',
    'node_shared_http_parser%': 'false',
    'node_shared_cares%': 'false',
    'node_shared_libuv%': 'false',
    'node_use_openssl%': 'true',
    'node_shared_openssl%': 'false',
    'node_v8_options%': '',
    'node_enable_v8_vtunejit%': 'false',
    'node_core_target_name%': 'node',
    'library_files': [
      'lib/internal/bootstrap_node.js',
      'lib/async_hooks.js',
      'lib/assert.js',
      'lib/buffer.js',
      'lib/child_process.js', //Remove this line
      'lib/console.js',
      'lib/constants.js',
      'lib/crypto.js',
      'lib/cluster.js',
      'lib/dgram.js',
      'lib/dns.js', //Remove this line too
[...]
请注意,这些模块用于测试和基准测试,例如在
lib/internal/v8\u prof\u polyfill.js和
lib/internal/cluster/master.js中使用
child\u process