Skip to content

Commit

Permalink
Add postinstall script to output how to use it
Browse files Browse the repository at this point in the history
`eleventy-sass` uses an experimental feature of Node.js 22 and users
must add `--experimental-require-module` option to their Node commands.

That is a breaking change and users must be notified of it.
  • Loading branch information
kentaroi committed Aug 16, 2024
1 parent ecefa02 commit 7323da8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "Yet another Sass/SCSS plugin for Eleventy. Source maps, PostCSS and revision hashes are supported.",
"main": "index.js",
"scripts": {
"postinstall": "node scripts/postinstall.js",
"test": "npx ava --timeout=3m --concurrency=1"
},
"repository": {
Expand Down
6 changes: 6 additions & 0 deletions scripts/postinstall.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const { yellow, green } = require("kleur");

console.log(yellow("`eleventy-sass` uses an experimental feature of Node 22 to load Eleventy 3 internal modules. You should add \"--experimental-require-module\" option to your Node commands. Therefore, instead of running `npx @11ty/eleventy`, use the following command:"));
console.log(green("npx --node-options=\"--experimental-require-module\" @11ty/eleventy"));
console.log("HOGE");
console.debug("FOO");

0 comments on commit 7323da8

Please sign in to comment.