Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#18] Chore: storybook 에 msw 적용 #19

Merged
merged 11 commits into from
Apr 26, 2024
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ const config: StorybookConfig = {
autodocs: 'tag',
},
staticDirs: ['../public'],
features: { experimentalRSC: true },
};
export default config;
3 changes: 3 additions & 0 deletions .storybook/preview.ts → .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { Preview } from '@storybook/react';
import { initialize, mswLoader } from 'msw-storybook-addon';

initialize({ onUnhandledRequest: 'bypass' });
const preview: Preview = {
parameters: {
controls: {
Expand All @@ -9,6 +11,7 @@ const preview: Preview = {
},
},
},
loaders: [mswLoader],
};

export default preview;
6 changes: 5 additions & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/** @type {import('next').NextConfig} */
const nextConfig = {};
const nextConfig = {
experimental: {
instrumentationHook: true,
},
};

export default nextConfig;
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"autoprefixer": "^10.0.1",
"axios": "^1.6.8",
"chromatic": "^11.3.0",
"eslint": "^8.57.0",
"eslint-config-next": "14.2.1",
Expand All @@ -49,11 +50,18 @@
"eslint-plugin-unused-imports": "^3.1.0",
"husky": "^9.0.11",
"lint-staged": "^15.2.2",
"msw": "^2.2.14",
"msw-storybook-addon": "^2.0.0",
"postcss": "^8",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.5.14",
"storybook": "^8.0.8",
"tailwindcss": "^3.4.1",
"typescript": "^5"
},
"msw": {
"workerDirectory": [
"public"
]
}
}
}
Loading
Loading