Skip to content

Commit

Permalink
fix: windows path fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thepassle committed May 28, 2024
1 parent 51d9704 commit 09f0333
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/storybook-builder/src/generate-app-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function generateAppScript(options: Options) {
const getPreviewAnnotationsFunction = `
const getProjectAnnotations = async () => {
const configs = await Promise.all([
${previewAnnotationURLs.map(previewAnnotation => ` import('${previewAnnotation}')`).join(',\n')}
${previewAnnotationURLs.map(previewAnnotation => ` import('${previewAnnotation.replace(/\\/g, '/')}')`).join(',\n')}
]);
return composeConfigs(configs);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook-builder/src/generate-stories-script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function toImportFn(stories: string[]) {
}

const importPath = toImportPath(relativePath);
let actualPath = path.join(process.cwd(), relativePath);
let actualPath = path.join(process.cwd(), relativePath).replace(/\\/g, '/');
if (actualPath.endsWith('.mdx')) {
actualPath = `${actualPath}.js`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const config = {
}

// ignore warning about eval in telejson
if (log.code === 'EVAL' && log.id?.includes('node_modules/telejson')) {
if (log.code === 'EVAL' && log.id?.replace(/\\/g, '/')?.includes('node_modules/telejson')) {
defaultHandler('warn', log);
return;
}
Expand Down

0 comments on commit 09f0333

Please sign in to comment.