zhouzilong2020 / nuxt3-migration-demo

A demo project for migrating from vue3 with vite to nuxt3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This is a demo project for migrating from vue3 with vite to nuxt3

The stack that need to be migrated:

tailwindCss

Tutorial

pinia

Tutorial This is an community solution, and the official document only provides tutorial for Nuxt2

naive-ui

Tutorial This is a demo provided by the author

vue-router

We use vue-router's interceptor in the old project and use /router/index.ts to specify our routes. However, nuxt integrates vue-router by default, and the routing is configured out of a naming convention.

Nuxt official provides a solution that allows us to configure a middleware to implement the interceptor logic. What should be emphasized is that Nuxt3 will override the routes and history options, and there is no way to control this.

vite plugin

Vite provides powerful plugins like unplugin-icons. Since nuxt3 uses vite by default, there are should be a way to do the same thing in nuxt3. Fortunately, unplugin-icons has added support to nuxt3. There is no big change between using vite and nuxt3, and your just need to copy the config from vite.config.ts to the relevant part in nuxt.config.ts

About

A demo project for migrating from vue3 with vite to nuxt3


Languages

Language:Vue 90.5%Language:TypeScript 8.6%Language:JavaScript 0.6%Language:CSS 0.2%