Nuxt Upgrade - ChoDragon9/posts GitHub Wiki
์ ๊ทธ๋ ์ด๋ ์ ๋ต
- Release Note๋ฅผ ํตํด ๋ฒ์ ์ ํ ๋จ๊ณ์ฉ ์ฌ๋ฆฐ๋ค.
- ์ด์๋ ๊ฒ์์ด ์๋ ์ ์์. ํ์์ ๋ณด๊ณ ํด๊ฒฐํ๋ค.
v2.9.2
Server ์ข ๋ฃ ๋๋ ํ์ ํด๊ฒฐ
2.8.0
=> 2.9.2
๋ฒ์ ์
๊ทธ๋ ์ด๋ ํ SPA ๋ชจ๋๋ ์ปค๋ฉ๋ ์ต์
์ผ๋ก ๋ณ๊ฒฝ๋์๋ค. ๊ฐ๋ฐ ๋จ๊ณ ์๋ฒ ์คํ ์, nuxt --spa
๋ก ์คํํด์ผ ํ๋ค.
scrollBehavior
nuxt 2.9.x ๋ถํฐ app/router.scrollBehavior.js๋ก ์ฒ๋ฆฌ
Decorator์๋ฌ ๋ฐ์
nuxt.config.ts๋ฅผ ์ ์์ ์ผ๋ก ์ฌ์ฉํ๊ธฐ ์ํด์๋ @nuxt/typescript-runtime
๋ชจ๋์ ์ค์นํด์ผ ํ๋ค.
nuxt.config.ts์๋ TypeScript๋ฅผ ์ฌ์ฉํ๋๋ก ์ค์ ํ๋ ํ์ผ์ด ์๋ค. ๊ทธ๋ ๊ธฐ ๋๋ฌธ์ Runtime ์ค์ ๋ ํ์ํ๋ค.
์ค์น ํ์๋ scripts
์ nuxt
๋ก ์ฌ์ฉํ๋ ๋ช
๋ น์ด๋ฅผ nuxt-ts
๋ก ๋ณ๊ฒฝ์ด ํ์ํ๋ค.
@nuxt/typescript, nuxt v.2.11.1
nuxt.config.ts
- import NuxtConfiguration from '@nuxt/config'
+ import { Configuration } from '@nuxt/types'
- const config: NuxtConfiguration = {
+ const config: Configuration = {
- devModules: [
- // Doc: https://github.com/nuxt-community/eslint-module
- '@nuxtjs/eslint-module'
- ],
+ buildModules: [
+ [
+ '@nuxt/typescript-build',
+ {
+ typeCheck: true,
+ ignoreNotFoundWarnings: true
+ }
+ ]
+ ],
package.json
- "dev": "nuxt",
- "build": "nuxt build",
- "generate": "nuxt generate",
- "start": "nuxt start",
+ "dev": "nuxt-ts --spa",
+ "build": "nuxt-ts build --spa",
+ "generate": "nuxt-ts generate",
+ "start": "nuxt-ts start",
"dependencies": {
+ "@nuxt/typescript-runtime": "^0.3.3",
- "nuxt": "^2.0.0",
+ "nuxt": "^2.11.0",
"devDependencies": {
- "@nuxt/typescript": "^2.8.1",
+ "@nuxt/typescript-build": "^0.5.2",
tsconfig.json
- "@nuxt/vue-app",
- "@nuxt/config"
+ "@nuxt/types"
middleware
- import { Middleware } from '@nuxt/vue-app'
+ import { Middleware } from '@nuxt/types'