-
Notifications
You must be signed in to change notification settings - Fork 6
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
11ty 3.0, version specifier and ESM #30
Comments
Thanks for letting me know, @pauleveritt. I will try to fix the plugin when I can find the time. |
I think you should be able to use |
Thank you for your comment, @MangelMaxime. However, |
Hi all! @kentaroi, do you have any plans of shipping an Eleventy 3 and ESM compatible version soon? I am very sorry to stress you, and I asked reluctantly too, but many of my projects depend on Eleventy and this plugin, so I can’t upgrade to Eleventy v3 without updating this plugin, too! There are not any solutions nearly as good as this! Thanks so much! Best, |
Hi, @xplosionmind! I apologise for any inconvenience this may cause. |
Hi, all! I just released
Therefore, instead of running npx --node-options="--experimental-require-module" @11ty/eleventy Eleventy 3 uses ES modules, which are quite restrictive, and probably there is no way to load internal modules in an NPM package whose type is "module" (ES module) from another NPM package whose type is also "module". Therefore, I keep the type of |
Thank you so much, @kentaroi! ❤️ I just updated the plugin, and it works well, except for the many warnings about the experimental “require in modules” feature of Node 22. I am not a JavaScript developer, so I am not sure, but I think that using require in modules is not necessarily the only solution. There is very useful information about this in this discussion. If you wish to smoothly transition to an ESM-first plugin, I believe it will be best. For the time being, thanks again, and have a great weekend! 🚀 |
Thank you for your comment, @xplosionmind! The discussion you referred to isn't directly related to my needs, but your comment made me revisit ES module features, and I think I found a way to do it in ES module. Thank you very much. Eleventy is a great Static Site Generator. However, it hasn't been extensible enough so far. Therefore, eleventy-sass has to access internal modules and patch them to make everything work, and it was easy for Eleventy 1 and 2, like this: const TemplateRender = require("@11ty/eleventy/src/TemplateRender"); However, the If you try to load an internal module with To address this problem, Probably, I found a way to do the same in ES module, but I haven't yet decided whether to make the plugin use ES modules or not. Thanks again, and I hope you have a great weekend, too! |
To silence the npx --node-options="--experimental-require-module --disable-warning=ExperimentalWarning" @11ty/eleventy |
- Install 11ty upgrade helper - Switch from CommonJS imports/exports to consistently using ESM imports/exports - That also allows us to remove the hacks we used to import things asynchronously - Add --experimental-require-module to 11ty runs, as required by eleventy-sass (see: kentaroi/eleventy-sass#30 (comment))
- Install 11ty upgrade helper - Switch from CommonJS imports/exports to consistently using ESM imports/exports - That also allows us to remove the hacks we used to import things asynchronously - Add --experimental-require-module to 11ty runs, as required by eleventy-sass (see: kentaroi/eleventy-sass#30 (comment))
Hi, we have an 11ty 3.0 project that we converted to ESM. Interested in getting rid of Vite and looking at this plugin for SCSS/PostCSS processing. First: thanks for working on this, fun reading through the source!
Since the
package.json
declares this is for 11ty 2.0 (-ish), I had to install with--force
.Then, when including the plugin in the 11ty config file:
This is likely related to turning on the ESM mode in 11ty 3.0. I realize this probably isn't something you've been thinking about, so I'm asking...reluctantly. 😉
The text was updated successfully, but these errors were encountered: