Skip to content

Commit

Permalink
chore: msw 설치
Browse files Browse the repository at this point in the history
  • Loading branch information
bottlewook committed Jan 10, 2024
1 parent a8a84cb commit 6d590c0
Show file tree
Hide file tree
Showing 3 changed files with 294 additions and 6 deletions.
16 changes: 16 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,20 @@ module.exports = {
sassOptions: {
includePaths: [path.join(__dirname, 'styles')],
},
webpack: (config, context) => {
if (context?.isServer) {
if (Array.isArray(config.resolve.alias)) {
config.resolve.alias.push({ name: "msw/browser", alias: false })
} else {
config.resolve.alias["msw/browser"] = false
}
} else {
if (Array.isArray(config.resolve.alias)) {
config.resolve.alias.push({ name: "msw/node", alias: false })
} else {
config.resolve.alias["msw/node"] = false
}
}
return config
},
}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-storybook": "^0.6.15",
"jsdom": "^23.2.0",
"msw": "^2.0.13",
"sass": "^1.69.6",
"storybook": "^7.6.6",
"storybook-react-context": "^0.6.0",
Expand All @@ -68,5 +69,8 @@
"vitest": "^1.1.3"
},
"readme": "ERROR: No README data found!",
"_id": "[email protected]"
"_id": "[email protected]",
"msw": {
"workerDirectory": "public"
}
}
Loading

0 comments on commit 6d590c0

Please sign in to comment.