Skip to content

Commit

Permalink
Merge pull request #27218 from AlexAtVista/bug/27172-builder-vite-sta…
Browse files Browse the repository at this point in the history
…ts-json-posix-paths

Vite: Fix stats-plugin to normalize file names with posix paths
(cherry picked from commit abfcc9f)
  • Loading branch information
valentinpalkovic authored and storybook-bot committed Jun 4, 2024
1 parent 901a8a8 commit 52a1b42
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import type { BuilderStats } from '@storybook/types';
import path from 'path';
import slash from 'slash';
import type { Plugin } from 'vite';

/*
Expand Down Expand Up @@ -58,7 +59,7 @@ export function pluginWebpackStats({ workingDir }: WebpackStatsPluginOptions): W
else {
const relativePath = path.relative(workingDir, stripQueryParams(filename));
// This seems hacky, got to be a better way to add a `./` to the start of a path.
return `./${relativePath}`;
return `./${slash(relativePath)}`;
}
}

Expand Down

0 comments on commit 52a1b42

Please sign in to comment.