Skip to content

Commit 12c1954

Browse files
committed
improve the README const consumption
1 parent 5664e26 commit 12c1954

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.storybook/main.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module.exports = {
2929

3030
config.define = {
3131
...(config.define || {}),
32-
__readme__: JSON.stringify(await readFile('README.md'))
32+
"process.env.__readme__": JSON.stringify(await readFile('README.md'))
3333
};
3434

3535
return config;

stories/1-dropzone.stories.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import CustomSlotDropzoneView from "./views/CustomSlotDropzoneView.svelte";
44
import NoClickDropZoneView from "./views/NoClickDropzoneView.svelte";
55
import NoDragDropzoneView from "./views/NoDragDropzoneView.svelte";
66

7+
import { README } from "./global";
8+
79
export default {
810
title: "Examples",
911
parameters: {
10-
notes: { Introduction: __readme__, 'Other': 'other' },
12+
notes: { Introduction: README, 'Other': 'other' },
1113
},
1214
};
1315

stories/2-advanced-dropzone.stories.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import WorkingCSVFileUploadView from "./views/WorkingCSVFileUploadView.svelte";
22
import FullyFeaturedDropzoneView from "./views/FullyFeaturedDropzoneView.svelte";
33

4+
import { README } from "./global";
5+
46
export default {
57
title: "Advanced Examples",
68
parameters: {
7-
notes: { Introduction: __readme__ },
9+
notes: { Introduction: README },
810
},
911
};
1012

stories/global.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// this definition gets resolved by Vite define configuration on `.storybook/main.cjs`
2+
export const README = process.env.__readme__;

0 commit comments

Comments
 (0)