React-Swiper1 Next.js + jest 설정 시 react/swiper 해석이 안되는 이슈 Next.js에서 jest를 설정하던 도중 react-swiper 라이브러리 때문에 꾀나 애 먹었습니다. 먼저 swiper/css 를 해석하지 못하는 부분입니다. moduleNameMapper: { ...jestConfig.moduleNameMapper, "swiper/css": "identity-obj-proxy", }, css 모듈을 해석할 수 있도록 identity-obj-proxy 라이브러리를 사용해 주면 됩니다. 해당 문제가 해결되니, Cannot use import statement outside a module 에러가 발생합니다. 해당 부분에 대한 이슈를 검색해 보니 transformIgnorePatterns: ["node_modules/(?!(swiper|ssr-window|dom7)/)".. 2024. 4. 22. 이전 1 다음