Repository: remix-run/react-router
File: packages/react-router-dev/vite/plugin.ts (TypeScript)

Code before:
      };

      browserRoutes[route.id] = routeManifestEntry;

      if (!routeIds || routeIds.includes(route.id)) {
        serverRoutes[route.id] = routeManifestEntry;
      }
    }

    let fingerprintedValues = { entry, routes: browserRoutes };
    let version = getHash(JSON.stringify(fingerprintedValues), 8);
    let manifestPath = path.posix.join(
      viteConfig.build.assetsDir,
      `manifest-${version}.js`
    );
    let url = `${ctx.publicPath}${manifestPath}`;
    let nonFingerprintedValues = { url, version };

    let reactRouterBrowserManifest: ReactRouterManifest = {
      ...fingerprintedValues,
      ...nonFingerprintedValues,
      sri: undefined,
    };

    // Write the browser manifest to disk as part of the build process
    await writeFileSafe(
      path.join(getClientBuildDirectory(ctx.reactRouterConfig), manifestPath),
      `window.__reactRouterManifest=${JSON.stringify(
        reactRouterBrowserManifest
      )};`
    );

    let sri: ReactRouterManifest["sri"] = undefined;
    if (ctx.reactRouterConfig.future.unstable_subResourceIntegrity) {
      sri = await generateSriManifest(ctx);
    }

    // The server manifest is the same as the browser manifest, except for
    // server bundle builds which only includes routes for the current bundle,
    // otherwise the server and client have the same routes
    let reactRouterServerManifest: ReactRouterManifest = {
      ...reactRouterBrowserManifest,
      routes: serverRoutes,
      sri,
    };

    return {
      reactRouterBrowserManifest,
      reactRouterServerManifest,
    };
  };

Review comment (suggestion):
I think this is intended to avoid shipping the sri map to the browser in `window.__reactRouterManifest` since we already have it in the `importmap`, but I don't think it's working quite right?  

![Screenshot 2025-03-06 at 11 03 28 AM](https://github.com/user-attachments/assets/4d36d2f4-e41a-4f0f-97d4-446dfae6560c)


Code after:
              viteManifest,
              getRouteChunkModuleId(routeFile, "HydrateFallback")
            )
          : undefined,
      };

      browserRoutes[route.id] = routeManifestEntry;

      if (!routeIds || routeIds.includes(route.id)) {
        serverRoutes[route.id] = routeManifestEntry;
      }
    }

    let fingerprintedValues = { entry, routes: browserRoutes };
    let version = getHash(JSON.stringify(fingerprintedValues), 8);
    let manifestPath = path.posix.join(
      viteConfig.build.assetsDir,
      `manifest-${version}.js`
    );
    let url = `${ctx.publicPath}${manifestPath}`;
    let nonFingerprintedValues = { url, version };

    let reactRouterBrowserManifest: ReactRouterManifest = {
      ...fingerprintedValues,
      ...nonFingerprintedValues,
      sri: undefined,
    };

    // Write the browser manifest to disk as part of the build process
    await writeFileSafe(
      path.join(getClientBuildDirectory(ctx.reactRouterConfig), manifestPath),
      `window.__reactRouterManifest=${JSON.stringify(
        reactRouterBrowserManifest
      )};`
    );

    let sri: ReactRouterManifest["sri"] = undefined;
    if (ctx.reactRouterConfig.future.unstable_subResourceIntegrity) {
      sri = await generateSriManifest(ctx);
    }

    // The server manifest is the same as the browser manifest, except for
    // server bundle builds which only includes routes for the current bundle,
    // otherwise the server and client have the same routes
    let reactRouterServerManifest: ReactRouterManifest = {
      ...reactRouterBrowserManifest,
      routes: serverRoutes,
      sri,
    };

    return {