본문 바로가기

개발/Vue.js

[vite] Vue3 + Typescript 프로젝트 생성

728x90
반응형

vue-cli만 사용해 오다가 vite가 그렇게 빠르대서 사용해보기로 했다.

 

우선 npm 버전과 vue 버전을 확인해 본다.

npm -version
8.11.0

vue --version
@vue/cli 5.0.1

 

프로젝트 생성

npm init vue@latest
Need to install the following packages:
  create-vite-app
Ok to proceed? (y)

create-vite-app 설치가 필요하다고 하면

 

Ctrl + C를 눌러 create-vite-app을 설치한다.

npm create vite@latest

 

커스터마이즈로 typescript + vue-router를 설치해준다.

Select a variant: » Customize with create-vue

 

 

다음과 같이 나오면 성공이다.

  cd vite-project
  npm install
  npm run lint
  npm run dev

 

Vetur 오류가 날 경우 비활성화 후

Volar 플러그인을 설치해준다!

728x90
반응형