본문 바로가기

javascript & Node.js/Next.js3

Redux with Nextjs (Typescript) 타입맞춰주는 것과 _app.js 에서의 작업에 애를먹어서 기록해놓음. 0. 사용환경 package.json "dependencies": { "next": "9.5.3", "next-redux-wrapper": "^6.0.2", "react": "^16.13.0", "react-dom": "^16.13.0", "react-redux": "^7.2.1", "redux": "^4.0.5" }, "devDependencies": { "@types/next-redux-wrapper": "^3.0.0", "@types/node": "12.0.12", "@types/react": "16.8.23", "@types/react-dom": "16.8.4", "@types/react-redux": "^7.1.9", "red.. 2020. 9. 14.
styled-components with Nextjs (Typescript) 0. 사용환경 create-next-app 으로 만든 애플리케이션 (typescript) package.json "dependencies": { "next": "9.5.3", "react": "^16.13.0", "react-dom": "^16.13.0", "styled-components": "^5.0.0" }, "devDependencies": { "@types/node": "12.0.12", "@types/react": "16.8.23", "@types/react-dom": "16.8.4", "@types/styled-components": "5.0.1", "babel-plugin-styled-components": "^1.10.0", "typescript": "4.0" }, 1. 바벨설정 .bab.. 2020. 9. 14.
Next.js 개요 Next.js 는 리액트를 서버사이드 렌더링할 때 쓰는 프레임워크이다. 특징 1. 웹팩, 자동 컴파일 및 번들링, 개발환경 제공. (next 내부적으론 웹팩과 바벨을 사용) 2. SSR 방식. 3. TypeScript 를 지원. 4. 파일시스템 라우팅 사용. 5. 내장 css 를 지원. 6. 코드스플리팅 지원. 7. 큰 기업들이 사용하고 있어 안정성이 보장됨. 사용법 사용법을 배워보자 필요환경 : Node 10.13v 이상 Setup npx create-next-app # or yarn create next-app 명령어를 사용하면 Next Project 를 빌드해준다. - dev: 개발용 서버로 프로젝트를 실행 - build: 배포용으로 빌드파일을 생성 - start: 배포용으로 실행 npm run d.. 2020. 9. 7.
반응형