Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow runtime to handle CJS #7

Open
yorinasub17 opened this issue Nov 9, 2023 · 0 comments
Open

Allow runtime to handle CJS #7

yorinasub17 opened this issue Nov 9, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@yorinasub17
Copy link
Member

Right now, the runtime only works with ESM code and ESM node modules (specifically, node modules that specify a module attr in the package.json). For better compatibility, we should add support CJS by adding in the CJS translation layer.

This can be implemented using https://github.com/denoland/deno/blob/9010b8df53cd37f0410e08c43a194667974686a2/ext/node/analyze.rs#L44

However, implementing this requires some dependency injection, namely the CJS analyzer and FS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant