Skip to content

Commit 5ea598f

Browse files
committed
test: got storybook to work
1 parent 280d86a commit 5ea598f

File tree

4 files changed

+17
-19
lines changed

4 files changed

+17
-19
lines changed

packages/headless/.storybook/main.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { qwikVite } from '@builder.io/qwik/optimizer';
2+
import { resolve } from 'path';
23
import { StorybookConfig } from 'storybook-framework-qwik';
34
// import { rootMain } from '../../../.storybook/main';
45

@@ -28,16 +29,17 @@ const config: StorybookConfig = {
2829
'../src/components/**/*.stories.@(js|jsx|ts|tsx)',
2930
],
3031

31-
// viteFinal: async (config: any) => {
32-
// return mergeConfig(config, {
33-
// plugins: [
34-
// viteTsConfigPaths({
35-
// root: '../../../',
36-
// }),
37-
// qwikVite(),
38-
// ],
39-
// });
40-
// },
32+
viteFinal: async (config: any) => {
33+
return mergeConfig(config, {
34+
plugins: [
35+
qwikVite({
36+
vendorRoots: [__dirname],
37+
srcDir: resolve(__dirname, '../src'),
38+
}),
39+
viteTsConfigPaths(),
40+
],
41+
});
42+
},
4143
};
4244

4345
export default config;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script>
2+
window.global = window;
3+
</script>

packages/headless/project.json

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,9 @@
6767
"notes": "${notes}"
6868
}
6969
},
70-
"storybook-when-it-will-work": {
70+
"storybook": {
7171
"executor": "@nrwl/storybook:storybook",
7272
"options": {
73-
"uiFramework": "@storybook/html",
7473
"port": 4400,
7574
"configDir": "packages/headless/.storybook"
7675
},
@@ -80,13 +79,6 @@
8079
}
8180
}
8281
},
83-
"storybook": {
84-
"executor": "nx:run-commands",
85-
"options": {
86-
"command": "storybook dev",
87-
"cwd": "packages/headless"
88-
}
89-
},
9082
"build-storybook": {
9183
"executor": "@nrwl/storybook:build",
9284
"outputs": ["{options.outputDir}"],

packages/headless/src/root.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default () => {};

0 commit comments

Comments
 (0)