mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-29 22:47:52 +02:00
fix(utils): always match exclusion root dirs as complete folder paths (#7864)
* fix(utils): always match exclusion root dirs as complete folder paths * fix * fix? * fix for real
This commit is contained in:
parent
3a0e90eacd
commit
40827c6c72
5 changed files with 35 additions and 5 deletions
packages/docusaurus-utils/src
|
@ -9,6 +9,7 @@
|
|||
|
||||
import path from 'path';
|
||||
import Micromatch from 'micromatch'; // Note: Micromatch is used by Globby
|
||||
import {addSuffix} from './jsUtils';
|
||||
|
||||
/** A re-export of the globby instance. */
|
||||
export {default as Globby} from 'globby';
|
||||
|
@ -68,7 +69,9 @@ export function createAbsoluteFilePathMatcher(
|
|||
|
||||
function getRelativeFilePath(absoluteFilePath: string) {
|
||||
const rootFolder = rootFolders.find((folderPath) =>
|
||||
absoluteFilePath.startsWith(folderPath),
|
||||
[addSuffix(folderPath, '/'), addSuffix(folderPath, '\\')].some((p) =>
|
||||
absoluteFilePath.startsWith(p),
|
||||
),
|
||||
);
|
||||
if (!rootFolder) {
|
||||
throw new Error(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue