mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-07 05:12:31 +02:00
fix: make Docusaurus PnP strict mode compatible (#6047)
Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
This commit is contained in:
parent
68b75bf855
commit
e07ebadf6c
65 changed files with 304 additions and 269 deletions
|
@ -23,7 +23,9 @@ import resolvePathnameUnsafe from 'resolve-pathname';
|
|||
import {posixPath as posixPathImport} from './posixPath';
|
||||
import {simpleHash, docuHash} from './hashUtils';
|
||||
import {normalizeUrl} from './normalizeUrl';
|
||||
import {DEFAULT_PLUGIN_ID} from './constants';
|
||||
|
||||
export * from './constants';
|
||||
export * from './mdxUtils';
|
||||
export * from './normalizeUrl';
|
||||
export * from './tags';
|
||||
|
@ -41,6 +43,7 @@ export {
|
|||
createMatcher,
|
||||
createAbsoluteFilePathMatcher,
|
||||
} from './globUtils';
|
||||
export * from './webpackUtils';
|
||||
|
||||
const fileHash = new Map();
|
||||
export async function generate(
|
||||
|
@ -282,7 +285,7 @@ export function getPluginI18nPath({
|
|||
siteDir,
|
||||
locale,
|
||||
pluginName,
|
||||
pluginId = 'default', // TODO duplicated constant
|
||||
pluginId = DEFAULT_PLUGIN_ID,
|
||||
subPaths = [],
|
||||
}: {
|
||||
siteDir: string;
|
||||
|
@ -298,10 +301,7 @@ export function getPluginI18nPath({
|
|||
locale,
|
||||
// Make it convenient to use for single-instance
|
||||
// ie: return "docs", not "docs-default" nor "docs/default"
|
||||
`${pluginName}${
|
||||
// TODO duplicate constant :(
|
||||
pluginId === 'default' ? '' : `-${pluginId}`
|
||||
}`,
|
||||
`${pluginName}${pluginId === DEFAULT_PLUGIN_ID ? '' : `-${pluginId}`}`,
|
||||
...subPaths,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue