Skip to content

Commit d22d0a9

Browse files
authored
Merge pull request #32812 from brandonroberts/fix-angular-preview-annotations
Angular: Add fileURLToPath for preview annotation paths
2 parents 05d448b + e5d342f commit d22d0a9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

code/frameworks/angular/src/preset.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@ export const previewAnnotations: PresetProperty<'previewAnnotations'> = async (
1616
const annotations = [...entries, config];
1717

1818
if ((options as any as StandaloneOptions).enableProdMode) {
19-
const previewProdPath = import.meta.resolve('@storybook/angular/client/preview-prod');
19+
const previewProdPath = fileURLToPath(
20+
import.meta.resolve('@storybook/angular/client/preview-prod')
21+
);
2022
annotations.unshift(previewProdPath);
2123
}
2224

2325
const docsConfig = await options.presets.apply('docs', {}, options);
2426
const docsEnabled = Object.keys(docsConfig).length > 0;
2527
if (docsEnabled) {
26-
const docsConfigPath = import.meta.resolve('@storybook/angular/client/docs/config');
28+
const docsConfigPath = fileURLToPath(
29+
import.meta.resolve('@storybook/angular/client/docs/config')
30+
);
2731
annotations.push(docsConfigPath);
2832
}
2933
return annotations;

0 commit comments

Comments
 (0)