diff --git a/code/builders/builder-vite/src/plugins/webpack-stats-plugin.ts b/code/builders/builder-vite/src/plugins/webpack-stats-plugin.ts index affb130c07e1..328c74ec9029 100644 --- a/code/builders/builder-vite/src/plugins/webpack-stats-plugin.ts +++ b/code/builders/builder-vite/src/plugins/webpack-stats-plugin.ts @@ -2,6 +2,7 @@ import type { BuilderStats } from '@storybook/types'; import path from 'path'; +import slash from 'slash'; import type { Plugin } from 'vite'; /* @@ -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)}`; } }