-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Support --serve and --watch when using Deno without package.json #3376
Comments
By the way, I'd be happy to open a PR if Eleventy is interested in supporting this feature! |
I think that’d be fine! First thoughts I’m wavering between:
Also is there a better idea than |
I do feel like A more specific one would be As for the values, I prefer |
Also, just now realized; you mentioned Anyways, I'll draft up a PR for this later. Shouldn't be too big of a change 😄 |
Great call on |
It seems that this change is necessary for Deno 2 (which is around the corner; Deno 1.46 is the last 1.x release). Deno 2 will complain that it cannot run Eleventy through @zachleat could you have a look at the pull request? It'd be ideal to have a fix merged before Deno 2 lands 🙂
|
Is your feature request related to a problem? Please describe.
Currently, Eleventy works beautifully with Deno. However, it requires a
package.json
with"type": "module"
to trigger Eleventy to go into ESM mode. I'd love it if I didn't need thepackage.json
, given I already havedeno.json
for my dependencies; my package.json contains only{ "type": "module" }
just to be able to--serve
my Eleventy site.Describe the solution you'd like
The cleanest is probably to default to ESM if no
package.json
is found (since Eleventy 3 is ESM-first).If that's undesirable, then the second-best solution is presumably a generic one; I'm thinking a flag
--force-esm
that forces Eleventy to go into ESM mode without looking forpackage.json
. This would not only solve the issue for Deno, but also for other runtimes such as Bun. Furthermore, it would provide Node users with the option to force ESM mode if needed without having to change the"type"
in theirpackage.json
(although I don't quite see a good use-case for this).Alternatively, Eleventy looks for
deno.json
ifpackage.json
doesn't exist. However, this is runtime-specific and so might not be the best solution (especially if Eleventy is not quite ready to commit to supporting Deno officially).Lastly, it could be a config option. The internal ESM flag is only used for watch and serve mode, so it should work, but this solution feels counter-intuitive to me since the config file itself needs to be read before the option can be set.
The text was updated successfully, but these errors were encountered: