Coder Social home page Coder Social logo

nextjs-setup's Introduction

Setup

Yarn, Nextjs, Typescript, Prettier, Eslint, SCSS, Redux, React-redux, Redux-thunk, Redux-dev-tools, axios...


1. Một số câu lệnh của yarn

  • Cài đặt yarn global
    • npm install -g yarn
  • Cập nhật phiên bản mới nhất
    • yarn set version latest
  • Truy cập danh sách các lệnh
    • yarn help
  • Khởi tạo một project
    • yarn init
  • Cài đặt tự động các thư viện
    • yarn
    • yarn install
  • Cài đặt một thư viện
    • yarn add [package]
    • yarn add [package]@[version]
    • yarn add [package]@[tag]
    • yarn add --dev [package] # dev dependencies
    • yarn add --peer [package] # peer dependencies
  • Cập nhật một thư viện
    • yarn up [package]
    • yarn up [package]@[version]
    • yarn up [package]@[tag]
  • Xóa một thư viện
    • yarn remove [package]
  • Chạy yarn CLI trong một thư mục cụ thể
    • yarn packages/my-new-lib init

2. Cài đặt typescript + các gói hỗ trợ typescript

  • echo {}> tsconfig.json
  • npm install --save-dev typescript @types/react @types/node
  • yarn add --dev typescript @types/react @types/node

3. Cài đặt prettier

  • yarn add --dev prettier
  • echo {}> .prettierrc.json
  • "prettier": "npx prettier --config .prettierrc.json --write \"pages/**/*.{tsx,ts}\""
{
    "bracketSpacing": true,
    "jsxSingleQuote": true,
    "semi": true,
    "singleQuote": true,
    "trailingComma": "none",
    "tabWidth": 2,
    "printWidth": 120
}

4. Cài đặt redux, react-redux, redux-thunk, redux-devtools-extension

  • yarn add redux react-redux redux-thunk
  • yarn add --dev redux-devtools-extension

5. Cài đặt axios

  • yarn add axios

6. Cài đặt node-sass

nextjs-setup's People

Contributors

ntdat104 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.