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

feat: Allow importing .cjs files #25426

Merged
merged 12 commits into from
Sep 5, 2024
Merged

Conversation

bartlomieju
Copy link
Member

This commit adds support for executing top-level .cjs files,
as well as import .cjs files from within npm packages.

This works only for .cjs files, the contents of sibling package.json
are not consulted for the "type" field.

Closes #25384

This commit adds support for executing top-level `.cjs` files, as well
as import `.cjs` files from within npm packages.

Co-Authored-By: Luca Casonato <[email protected]>
cli/resolver.rs Outdated Show resolved Hide resolved
tools/lint.js Outdated Show resolved Hide resolved
Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

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

LGTM. We're going to follow-up this later to fix the issues with it.

@bartlomieju bartlomieju enabled auto-merge (squash) September 5, 2024 07:39
@bartlomieju bartlomieju merged commit dfc5eec into denoland:main Sep 5, 2024
17 checks passed
@bartlomieju bartlomieju deleted the import_cjs branch September 5, 2024 07:59
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.

Importing a file ending in .cjs (in Deno mode) should treat the file as cjs
3 participants