Skip to content

Conversation

@brendandahl
Copy link
Collaborator

This enables commonjs modules to be imported into TypeScript using the same syntax as ESM modules e.g.

import moduleFactory from './embind_tsgen.js';

This enables commonjs modules to be imported into TypeScript using the same
syntax as ESM modules e.g.

`import moduleFactory from './embind_tsgen.js';`
@parameterized({
'': [[]],
'with_jsgen': [['-sEMBIND_AOT']]
'commonjs': [['-sMODULARIZE'], ['--module', 'commonjs', '--moduleResolution', 'node']],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: this roughly matches how emscripten output is used in g3.

@brendandahl brendandahl merged commit bb2a7f0 into emscripten-core:main Dec 4, 2024
24 of 28 checks passed
hedwigz pushed a commit to hedwigz/emscripten that referenced this pull request Dec 18, 2024
…core#22988)

This enables commonjs modules to be imported into TypeScript using the
same syntax as ESM modules e.g.

`import moduleFactory from './embind_tsgen.js';`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants