src/vs/platform/files/node/watcher/parcel/parcelWatcher.ts/ParcelWatcher/toExcludePaths
class ParcelWatcher:	protected toExcludePaths(path: string, excludes: string[] | undefined): string[] | undefined {
		if (!Array.isArray(excludes)) {
			return undefined;
		}

		const excludePaths = new Set<string>();

		// Parcel watcher currently does not support glob patterns
		// for native exclusions. As long as that is the case, try
		// to convert exclude patterns into absolute paths that the
		// watcher supports natively to reduce the overhead at the
		// level of the file watcher as much as possible.
		// Refs: https://github.com/parcel-bundler/watcher/issues/64
		for (const exclude of excludes) {
			const isGlob = exclude.includes(ParcelWatcher.GLOB_MARKERS.Star);

			// Glob pattern: check for typical patterns and convert
			let normalizedExclude: string | undefined = undefined;
			if (isGlob) {

				// Examples: **, **/**, **\**
				if (
					exclude === ParcelWatcher.GLOB_MARKERS.GlobStar ||
					exclude === ParcelWatcher.GLOB_MARKERS.GlobStarPosix ||
					exclude === ParcelWatcher.GLOB_MARKERS.GlobStarWindows
				) {
					normalizedExclude = path;
				}

				// Examples:
				// - **/node_modules/**
				// - **/.git/objects/**
				// - **/build-folder
				// - output/**
				else {
					const startsWithGlobStar = exclude.startsWith(ParcelWatcher.GLOB_MARKERS.GlobStarPathStartPosix) || exclude.startsWith(ParcelWatcher.GLOB_MARKERS.GlobStarPathStartWindows);
					const endsWithGlobStar = exclude.endsWith(ParcelWatcher.GLOB_MARKERS.GlobStarPathEndPosix) || exclude.endsWith(ParcelWatcher.GLOB_MARKERS.GlobStarPathEndWindows);
					if (startsWithGlobStar || endsWithGlobStar) {
						if (startsWithGlobStar && endsWithGlobStar) {
							normalizedExclude = exclude.substring(ParcelWatcher.GLOB_MARKERS.GlobStarPathStartPosix.length, exclude.length - ParcelWatcher.GLOB_MARKERS.GlobStarPathEndPosix.length);
						} else if (startsWithGlobStar) {
							normalizedExclude = exclude.substring(ParcelWatcher.GLOB_MARKERS.GlobStarPathStartPosix.length);
						} else {
							normalizedExclude = exclude.substring(0, exclude.length - ParcelWatcher.GLOB_MARKERS.GlobStarPathEndPosix.length);
						}
					}

					// Support even more glob patterns on Linux where we know
					// that each folder requires a file handle to watch.
					// Examples:
					// - node_modules/* (full form: **/node_modules/*/**)
					if (isLinux && normalizedExclude) {
						const endsWithStar = normalizedExclude?.endsWith(ParcelWatcher.GLOB_MARKERS.StarPathEndPosix);
						if (endsWithStar) {
							normalizedExclude = normalizedExclude.substring(0, normalizedExclude.length - ParcelWatcher.GLOB_MARKERS.StarPathEndPosix.length);
						}
					}
				}
			}

			// Not a glob pattern, take as is
			else {
				normalizedExclude = exclude;
			}

			if (!normalizedExclude || normalizedExclude.includes(ParcelWatcher.GLOB_MARKERS.Star)) {
				continue; // skip for parcel (will be applied later by our glob matching)
			}

			// Absolute path: normalize to watched path and
			// exclude if not a parent of it otherwise.
			if (isAbsolute(normalizedExclude)) {
				if (!isEqualOrParent(normalizedExclude, path, !isLinux)) {
					continue; // exclude points to path outside of watched folder, ignore
				}

				// convert to relative path to ensure we
				// get the correct path casing going forward
				normalizedExclude = normalizedExclude.substr(path.length);
			}

			// Finally take as relative path joined to watched path
			excludePaths.add(rtrim(join(path, normalizedExclude), sep));
		}

		if (excludePaths.size > 0) {
			return Array.from(excludePaths);
		}

		return undefined;
	}