function deriveAbsolutePathFromContext(
  from: string,
  context: RequireContextParams,
): string {
  // Drop the trailing slash, require.context should always be matched against a folder
  // and we want to normalize the folder name as much as possible to prevent duplicates.
  // This also makes the files show up in the correct location when debugging in Chrome.
  const filePath = from.endsWith(path.sep) ? from.slice(0, -1) : from;
  return (
    filePath +
    '?ctx=' +
    toHash(
      [
        context.mode,
        context.recursive ? 'recursive' : '',
        new RegExp(context.filter.pattern, context.filter.flags).toString(),
      ]
        .filter(Boolean)
        .join(' '),
    )
  );
}
Given a fully qualified require context, return a virtual file path that ensures uniqueness between paths with different contexts.