Skip to content

Commit

Permalink
fix: basename in getStylesForUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Nov 27, 2023
1 parent ac7c0e0 commit 01e201f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/remix-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ type RemixConfigJsdocOverrides = {
*/
serverBuildPath?: SupportedRemixConfig["serverBuildPath"];
/**
* TODO: doc
* TODO: for now sneak this in as remix vite only option
*/
basename?: string;
};
Expand Down
6 changes: 4 additions & 2 deletions packages/remix-dev/vite/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ const createRoutes = (

export const getStylesForUrl = async (
vite: ViteDevServer,
config: Pick<ResolvedRemixConfig, "appDirectory" | "routes" | "publicPath">,
config: Pick<ResolvedRemixConfig, "appDirectory" | "routes"> & {
basename: string;
},
cssModulesManifest: Record<string, string>,
build: ServerBuild,
url: string | undefined
Expand All @@ -169,7 +171,7 @@ export const getStylesForUrl = async (
let routes = createRoutes(build.routes);
let appPath = path.relative(process.cwd(), config.appDirectory);
let documentRouteFiles =
matchRoutes(routes, url, config.publicPath)?.map((match) =>
matchRoutes(routes, url, config.basename)?.map((match) =>
path.join(appPath, config.routes[match.route.id].file)
) ?? [];

Expand Down

0 comments on commit 01e201f

Please sign in to comment.