Skip to content

Commit 5f73ebb

Browse files
committed
chore: update SWC configuration for TypeScript support & bump addon-webpack5-compiler-swc
1 parent baae0f1 commit 5f73ebb

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

apps/site/.storybook/main.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,19 @@ const config: StorybookConfig = {
1111
typescript: { reactDocgen: false, check: false },
1212
core: { disableTelemetry: true, disableWhatsNewNotifications: true },
1313
framework: '@storybook/react-webpack5',
14-
swc: () => ({ jsc: { transform: { react: { runtime: 'automatic' } } } }),
14+
swc: () => ({
15+
jsc: {
16+
parser: {
17+
syntax: 'typescript',
18+
tsx: true,
19+
},
20+
transform: {
21+
react: {
22+
runtime: 'automatic',
23+
},
24+
},
25+
},
26+
}),
1527
addons: [
1628
'@storybook/addon-webpack5-compiler-swc',
1729
'@storybook/addon-controls',

apps/site/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
"@storybook/addon-styling-webpack": "^1.0.1",
8484
"@storybook/addon-themes": "^8.4.6",
8585
"@storybook/addon-viewport": "^8.4.6",
86-
"@storybook/addon-webpack5-compiler-swc": "^1.0.5",
86+
"@storybook/addon-webpack5-compiler-swc": "^2.0.0",
8787
"@storybook/react-webpack5": "^8.4.6",
8888
"@testing-library/jest-dom": "~6.6.3",
8989
"@testing-library/react": "~16.1.0",

package-lock.json

Lines changed: 4 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)