Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
markdalgleish committed Feb 25, 2024
1 parent 6ea2a38 commit 6b125cb
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/remix-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -774,15 +774,12 @@ export const remixVitePlugin: RemixVitePlugin = (remixUserConfig = {}) => {
return new Set([...cssUrlPaths, ...chunkAssetPaths]);
};

let getClientBuildAssetsDirectory = () => {
invariant(viteConfig);
return viteConfig.build.assetsDir;
};

let generateRemixManifestsForBuild = async (): Promise<{
remixBrowserManifest: RemixManifest;
remixServerManifest: RemixManifest;
}> => {
invariant(viteConfig);

let viteManifest = await loadViteManifest(
getClientBuildDirectory(ctx.remixConfig)
);
Expand Down Expand Up @@ -838,8 +835,8 @@ export const remixVitePlugin: RemixVitePlugin = (remixUserConfig = {}) => {

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

0 comments on commit 6b125cb

Please sign in to comment.