-
Notifications
You must be signed in to change notification settings - Fork 8
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
Upgrade Eleventy from 2 to 3 #98
Conversation
おお、11tyのUPGRADE! |
080210e
to
5aee82c
Compare
@akira888 |
Eleventy v3.0.0 fully supports ESM. - ref: https://github.com/11ty/eleventy/releases/tag/v3.0.0 Additionally, using `require("@11ty/eleventy")` with Eleventy v3.0.0 results in compatibility issues as follows. Therefore, this is an appropriate time to migrate our configuration from CommonJS to ESM. ``` > [email protected] build:11ty > eleventy --pathprefix=hotwire_ja [11ty] Eleventy Error (CLI): [11ty] 1. Error in your Eleventy config file '.eleventy.js'. (via EleventyConfigError) [11ty] 2. `require("@11ty/eleventy")` is incompatible with Eleventy v3 and this version of Node. You have a few options: [11ty] 1. (Easiest) Change the `require` to use a dynamic import inside of an asynchronous CommonJS configuration [11ty] callback, for example: [11ty] [11ty] module.exports = async function { [11ty] const {EleventyRenderPlugin, EleventyI18nPlugin, EleventyHtmlBasePlugin} = await import("@11ty/eleventy"); [11ty] } [11ty] [11ty] 2. (Easier) Update the JavaScript syntax in your configuration file from CommonJS to ESM (change `require` [11ty] to use `import` and rename the file to have an `.mjs` file extension). [11ty] [11ty] 3. (More work) Change your project to use ESM-first by adding `"type": "module"` to your package.json. Any [11ty] `.js` will need to be ported to use ESM syntax (or renamed to `.cjs`.) [11ty] [11ty] 4. (Short term workaround) Use the --experimental-require-module flag to enable this behavior. Read [11ty] more: https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require It is possible that the [11ty] newest version of Node has this enabled by default—you can try upgrading your version of Node.js. ERROR: "build:11ty" exited with 1. ```
5aee82c
to
2aaeed3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build時に SASSについて とやかく言われているのを見かけてしまいましたがw
11ty自体の version up は問題なさそうでした!
早めの追随ありがとうございます!
SassはもうひとつのPRでご対応いただいていたのですね |
レビューありがとうございます。マージします! |
ref: #92
Eleventy v3.0.0 fully supports ESM.
Additionally, using
require("@11ty/eleventy")
with Eleventy v3.0.0 resultsin compatibility issues as follows. Therefore, this is an appropriate time to
migrate our configuration from CommonJS to ESM.