-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add helper plugin for 11ty/eleventy#3373
- Loading branch information
Showing
3 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
const fs = require("node:fs"); | ||
const chalk = require("kleur"); | ||
const pkg = require("../package.json"); | ||
|
||
const minimist = require("minimist"); | ||
|
||
const argv = minimist(process.argv.slice(2), { | ||
string: ["config"] | ||
}); | ||
|
||
module.exports = function(eleventyConfig) { | ||
let type = chalk.blue("NOTICE"); | ||
|
||
if(argv.config && !fs.existsSync(argv.config)) { | ||
// We’ll never get here because the configuration file has to work to run the upgrade plugin. | ||
type = chalk.red("ERROR"); | ||
} | ||
|
||
console.log(chalk.blue(`[${pkg.name}]`), type, `Eleventy will fail with an error when you point \`--config\` to a configuration file that does not exist. Previous versions ran as-is (without application configuration). Read more: https://github.com/11ty/eleventy/issues/3373`); | ||
}; |