feat: mdx loader fallback, allow importing mdx docs from anywhere (#5299)

* move deep filepath test

* split markdownPageExample.md

* re-org dogfooding content

* Add mdx partials fallback synthetic plugin by default

* test commit

* hide changelog title as it's already included in the partial file

* trigger CI

* fix changelog sidebar label
This commit is contained in:
Sébastien Lorber 2021-08-06 11:32:22 +02:00 committed by GitHub
parent 780e924a9e
commit 916b82119b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 354 additions and 276 deletions

View file

@ -98,11 +98,16 @@ File at ${filePath} contains FrontMatter that will be ignored: \n${JSON.stringif
null,
2,
)}`;
const shouldError = process.env.NODE_ENV === 'test' || process.env.CI;
if (shouldError) {
return callback(new Error(errorMessage));
if (options.isMDXPartialFrontMatterWarningDisabled === true) {
// no warning
} else {
console.warn(chalk.yellow(errorMessage));
const shouldError = process.env.NODE_ENV === 'test' || process.env.CI;
if (shouldError) {
return callback(new Error(errorMessage));
} else {
console.warn(chalk.yellow(errorMessage));
}
}
}