-
-
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.
Upgrade helper for 11ty/eleventy#3327
- Loading branch information
Showing
2 changed files
with
19 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const chalk = require("kleur"); | ||
const pkg = require("../package.json"); | ||
|
||
// https://v2-0-1.11ty.dev/docs/languages/html/#using-the-same-input-and-output-directories | ||
module.exports = function(eleventyConfig) { | ||
eleventyConfig.on("eleventy.config", ({ config }) => { | ||
if(!("htmlOutputSuffix" in config)) { | ||
console.log(chalk.blue(`[${pkg.name}]`), chalk.blue(`NOTICE`), `The \`htmlOutputSuffix\` feature was removed. It doesn’t look like you were using it!`); | ||
} else { | ||
console.log(chalk.red(`[${pkg.name}]`), chalk.red(`ERROR`), `The \`htmlOutputSuffix\` feature was removed. Learn more: https://github.com/11ty/eleventy/issues/3327`); | ||
} | ||
}) | ||
|
||
// Input and output are the same | ||
if(eleventyConfig.directories.input === eleventyConfig.directories.output) { | ||
console.log(chalk.yellow(`[${pkg.name}] WARNING`), `Your input and output folders are identical so please take note that Eleventy 3.0 will throw an error if any of your output files attempt to overwrite your input files. Learn more: https://github.com/11ty/eleventy/issues/3327`); | ||
} | ||
}; |