node/test/addons/esm/binding.gyp
Chengzhong Wu d302cb3bb2
esm: add experimental support for addon modules
PR-URL: https://github.com/nodejs/node/pull/55844
Backport-PR-URL: https://github.com/nodejs/node/pull/59961
Fixes: https://github.com/nodejs/node/issues/40541
Fixes: https://github.com/nodejs/node/issues/55821
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Jacob Smith <jacob@frende.me>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-09-22 14:28:01 +00:00

40 lines
1 KiB
Python

{
'variables': {
'source_dir': '<!(<(python) -c "import os; print(os.getcwd())")',
},
'targets': [
{
'target_name': 'binding',
'sources': [ 'binding.cc' ],
'includes': ['../common.gypi'],
},
{
'target_name': 'binding-export-default',
'sources': [ 'binding-export-default.cc' ],
'includes': ['../common.gypi'],
},
{
'target_name': 'binding-export-primitive',
'sources': [ 'binding-export-primitive.cc' ],
'includes': ['../common.gypi'],
},
{
'target_name': 'node_modules',
'type': 'none',
'dependencies': [
'binding',
],
# The `exports` in package.json can not reference files outside the package
# directory. Copy the `binding.node` into the package directory so that
# it can be exported with the conditional exports.
'copies': [
{
'files': [
'<(PRODUCT_DIR)/binding.node'
],
'destination': '<(source_dir)/node_modules/esm-package/build',
},
],
}
]
}