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

Add --loader flag to force ESM/CJS mode #3377

Merged
merged 7 commits into from
Sep 3, 2024

Conversation

vrugtehagel
Copy link
Contributor

@vrugtehagel vrugtehagel commented Jul 23, 2024

Resolves #3376.

This PR adds a loader option for the Eleventy class and a --loader command line flag. The value must be either "esm" (to force ESM mode), "cjs" (to force CommonJS mode) or "auto" (default, infer it from package.json; the current behavior).

In particular this allows other runtimes to run Eleventy without requiring a package.json.

@vrugtehagel vrugtehagel changed the title Add loader param Add --loader flag to force ESM/CJS mode Jul 25, 2024
@vrugtehagel vrugtehagel requested a review from zachleat as a code owner August 13, 2024 14:06
@zachleat zachleat merged commit 72eb7ef into 11ty:main Sep 3, 2024
9 checks passed
@zachleat
Copy link
Member

zachleat commented Sep 3, 2024

Shipping with 3.0.0-beta.2 and 3.0.0-alpha.19, thank you!

@zachleat zachleat added this to the Eleventy 3.0.0 milestone Sep 3, 2024
@vrugtehagel vrugtehagel deleted the vrugtehagel/add-loader-param branch September 4, 2024 13:14
@zachleat zachleat added the needs-documentation Documentation for this issue/feature is pending! label Sep 20, 2024
@zachleat
Copy link
Member

Punting docs for this one to #3459

@zachleat zachleat removed the needs-documentation Documentation for this issue/feature is pending! label Sep 26, 2024
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.

Support --serve and --watch when using Deno without package.json
2 participants