Skip to content

eleventy-upgrade-help v3.0? #3196

Answered by jeromecoupe
rocc-o asked this question in General
Feb 10, 2024 · 1 comments · 4 replies
Discussion options

You must be logged in to vote

Migrating to ESM can be a bit daunting at first but, when you get going, it should be quite straightforward. I converted my (fairly simple) website in less than an hour. Creating a new branch for the conversion made me fell a lot ore at ease with the process ;o)
I started with adding type="module" to my package.json and them moved to eleventy.config.js

Example for a plugin

This:
const { EleventyRenderPlugin } = require("@11ty/eleventy");
Should become
import { EleventyRenderPlugin } from "@11ty/eleventy";

Beyond the config, I mainly had to convert filters, shortcodes and global and directory data files to ESM syntax.

What helped me most was to look at other ESM conversions and find out wh…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@rocc-o
Comment options

@mendhak
Comment options

@bobmonsour
Comment options

@bobmonsour
Comment options

Answer selected by rocc-o
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants