본문 바로가기

전체 글

(126)
의존성 production install 후 next build 시 next.config.mjs 에@next/bundle-analyzer 라이브러리 못찾는 에러 해결 production install 은 devDependencies에 나열 된 패키지를 설치하지 않는 것으로, # npm npm install --production # yarn yarn install --production 하지만 위와 같이 하게된다면 next.config.mjs 에서 next build 시 에러가 발생한다. 이유는 @next/bundle-analyzer 를 찾을 수 없기 떄문이다. @next/bundle-analyzer 는 devDependencies 에 있기 때문에 production install 시에 설치되지 않는다. 물론 해당 의존성을 dependencies 로 옮기면 바로 해결 될 문제이겠지만, 이런 하드한 방법을 사용하고 싶지 않았다. 일단 에러가 나는 이유는 next.con..
nextjs 에서 antd 5.x 와 tailwind 적용 tailwind 적용은 https://tailwindcss.com/docs/guides/nextjs 참고 보통 antd 에 tailwind 를 추가로 쓰려고하는 사람은 아마? 대부분 간단한 스타일링을 할 때 (ex: padding, margin 등) inner style은 싫고, 그렇다고 css module 이나 css-in-js 를 사용해 파일을 추가로 생성하는게 부담스러울 때 쓰려고 한다고 생각한다. ※ tailwind 만으로 컴포넌트를 백프로 제작하길 원한다면 쿨하게 antd와 같은 UI 디자인은 버리기를 추천(UI Design 이중화 방지!)한다! tailwind 기본 설정이 끝났다면 tailwind.config.js 에 딱 두줄만 추가해주면 된다. /** @type {import('tailwin..
[Nodejs] phantomjs 사용하여 pdf 파일 추출하기 소스코드 const phantom = require('phantom'); const fs = require('fs'); const fileUtils = new FileUtils(); const uploadFolder = `${process.env.UPLOAD_FOLDER_SMTP_ATTACH}${orderInfo.orderNo}`; const flag = await fileUtils.mkdir(uploadFolder); const attachFile = orderInfo.orderNo + '.pdf'; const instance = await phantom.create(); const page = await instance.createPage(); const file = 'invoicePaid.html'..