react 패키지를 next로 컴파일 하는 패키지

2023. 8. 6. 10:42·Tips

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
'Tips' 카테고리의 다른 글
  • 특정 문자가 이모지로 치환되어 보이는 이슈
  • ios 비동기로 input에 focus
  • gitignore에 dist추가해도 tracking 되는 이슈
  • Swiper.js slidesPerGroup 슬라이드 여러장씩 이동시키기
ssund
ssund
  • ssund
    ssund의 기술블로그
    ssund
  • 전체
    오늘
    어제
    • TECH (82)
      • Next.js (8)
      • React (25)
      • Vite (1)
      • javascript (17)
      • CSS (6)
      • CS (10)
      • AWS (0)
      • Jest (1)
      • CI|CD (0)
      • 알고리즘 (8)
      • Tools (1)
      • Tips (5)
  • 블로그 메뉴

    • 링크

    • 공지사항

    • 인기 글

    • 태그

      reat-head
      redux
      app-router
      웹브라우저구성
      커머스프로젝트
      서버컴포넌트
      global-style
      타입스크립트
      git배포
      styled-components
      Array.sort()
      nextjs
      react state management
      call signatures
      배열요소순서
      React
      TypeScript
      JavaScript
      theme-provider
      함수와 메서드차이
    • 최근 댓글

    • 최근 글

    • hELLO· Designed By정상우.v4.10.0
    ssund
    react 패키지를 next로 컴파일 하는 패키지
    상단으로

    티스토리툴바