Skip to content

Commit

Permalink
Merge pull request #2469 from modernweb-dev/fix/sb-windows
Browse files Browse the repository at this point in the history
fix: storybook import for windows
  • Loading branch information
thepassle authored Sep 29, 2023
2 parents 9ca6875 + 7ae27f3 commit 8ba24e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/red-bears-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@web/dev-server-storybook": patch
"@web/dev-server": patch
---

fix: storybook import for windows
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import path from 'path';
import fs from 'fs';
import { pathToFileURL } from 'url';

import { StorybookPluginConfig } from './StorybookPluginConfig.js';
import { createError } from '../utils.js';
Expand Down Expand Up @@ -70,7 +71,7 @@ export async function readStorybookConfig(

const mainJs = commonJsMainExists
? validateMainJs((await import(commonJsMainPath)).default)
: validateMainJs((await import(mainJsPath)).default);
: validateMainJs((await import(pathToFileURL(mainJsPath).href)).default);

return {
mainJs,
Expand Down

0 comments on commit 8ba24e5

Please sign in to comment.