react에서 사용했던 패키지를 next환경에서 써야하는 상황
next 환경에서 작동할수있도록 컴파일 해주는 패키지 발견
https://www.npmjs.com/package/next-transpile-modules
1. npm 모듈 설치
npm i next-transpile-modules
2. next.config 파일 설정하기
const config = require('config');
const { format } = require('date-fns');
const { ko } = require('date-fns/locale');
/** @type {import('next').NextConfig} */
const withTM = require("next-transpile-modules")([
"@fullcalendar/common",
"@fullcalendar/daygrid",
"@fullcalendar/interaction",
"@fullcalendar/react",
"@fullcalendar/timegrid",
]);
/** @type {import('next').NextConfig} */
const nextConfig = withTM({
reactStrictMode: true,
... 다른옵션들
});
module.exports = nextConfig;
react node-module을 컴파일해서 next환경에서도 이슈없도록 해준다.!
'Tips' 카테고리의 다른 글
| 특정 문자가 이모지로 치환되어 보이는 이슈 (0) | 2025.08.31 |
|---|---|
| ios 비동기로 input에 focus (0) | 2024.12.27 |
| gitignore에 dist추가해도 tracking 되는 이슈 (0) | 2024.06.27 |
| Swiper.js slidesPerGroup 슬라이드 여러장씩 이동시키기 (0) | 2023.02.03 |