HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
육개짱 프론트엔드
육개짱 프론트엔드
/
서버 api , MSW 껐다 키는 방법

서버 api , MSW 껐다 키는 방법

⚙️ 세팅

// vite.config.ts server: { proxy: { "/api": { target: "http://3.39.156.144:8080", changeOrigin: true, }, }, },
 
// .env VITE_BASE_URL = VITE_AUTH_JWT_TOKEN_STORAGE_KEY = access VITE_REFRESH_JWT_TOKEN_STORAGE_KEY = refresh
 

전체 vite.config.ts 코드

export default defineConfig(({ command }) => ({ plugins: [react(), tsconfigPaths(), splitVendorChunkPlugin()], publicDir: command === "serve" ? "public" : false, server: { proxy: { "/api": { target: "http://3.39.156.144:8080", changeOrigin: true, }, }, }, build: { chunkSizeWarningLimit: 1600, rollupOptions: { plugins: [ visualizer({ open: false, gzipSize: true, brotliSize: true, }), ], output: { manualChunks: (id) => { if (id.includes("node_modules")) { return id .toString() .split("node_modules/")[1] .split("/")[0] .toString() } }, }, }, }, }))
 
다 적용하셨으면 IDE 한 번 껐다 켜야 됩니다!
 
‘ctrl’ + ‘shift’ + P 눌러서 Reload window 실행하시면 되요~
 
 

🖱️ MSW 껐다 켜기

 
  1. 브라우저 개발자도구(f12)의 ‘애플리케이션’으로 들어갑니다.
notion image
 
  1. Service workers 탭에서 ‘네트워크 우회’(bypass for network)를 클릭!
notion image
 
💡
클릭된 상태면 MSW가 꺼진 상태가 됩니다!