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

2023. 8. 6. 10:42·NOTE

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환경에서도 이슈없도록 해준다.! 

'NOTE' 카테고리의 다른 글

react-hook-form validate with zod  (0) 2023.08.17
typescript 배열 중 하나 타입으로 선언하기  (0) 2023.08.16
리액트 오류: React DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node  (0) 2023.08.05
string 대문자, 소문자 체크하기  (0) 2023.05.05
String.charAt(index)  (0) 2023.05.05
'NOTE' 카테고리의 다른 글
  • react-hook-form validate with zod
  • typescript 배열 중 하나 타입으로 선언하기
  • 리액트 오류: React DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node
  • string 대문자, 소문자 체크하기
ssund
ssund
  • ssund
    ssund의 기술블로그
    ssund
  • 전체
    오늘
    어제
    • 분류 전체보기 (73)
      • TECH (22)
      • NOTE (40)
      • DAILY (7)
      • javascript (1)
      • 알고리즘 (0)
  • 블로그 메뉴

    • 홈
    • TECH
    • NOTE
    • DAILY
  • 링크

  • 공지사항

  • 인기 글

  • 태그

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

  • 최근 글

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

티스토리툴바