├── .npmrc ├── .eslintrc ├── .eslintignore ├── tsconfig.json ├── .gitignore ├── public ├── nuxt.png └── vite.png ├── .stackblitzrc ├── server └── api │ └── pageview.ts ├── styles └── main.css ├── app.vue ├── netlify.toml ├── composables └── count.ts ├── pages ├── index.vue └── hi │ └── [id].vue ├── components ├── Footer.vue ├── DarkToggle.vue ├── PageView.vue ├── Counter.vue ├── Logos.vue └── InputEntry.vue ├── package.json ├── store └── user.ts ├── nuxt.config.ts └── README.md /.npmrc: -------------------------------------------------------------------------------- 1 | shamefully-hoist=true 2 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@antfu" 3 | } 4 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | dist 2 | node_modules 3 | .output 4 | .nuxt 5 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./.nuxt/tsconfig.json" 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.log 3 | dist 4 | .output 5 | .nuxt 6 | .env 7 | -------------------------------------------------------------------------------- /public/nuxt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mr-dev-dragon/vitesse-nuxt3/HEAD/public/nuxt.png -------------------------------------------------------------------------------- /public/vite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mr-dev-dragon/vitesse-nuxt3/HEAD/public/vite.png -------------------------------------------------------------------------------- /.stackblitzrc: -------------------------------------------------------------------------------- 1 | { 2 | "installDependencies": true, 3 | "startCommand": "npm run dev" 4 | } 5 | -------------------------------------------------------------------------------- /server/api/pageview.ts: -------------------------------------------------------------------------------- 1 | const startAt = Date.now() 2 | let count = 0 3 | 4 | export default defineEventHandler(() => ({ 5 | pageview: count++, 6 | startAt, 7 | })) 8 | -------------------------------------------------------------------------------- /styles/main.css: -------------------------------------------------------------------------------- 1 | html, 2 | body, 3 | #app { 4 | height: 100vh; 5 | margin: 0; 6 | padding: 0; 7 | } 8 | 9 | html.dark { 10 | background: #222; 11 | color: white; 12 | } 13 | -------------------------------------------------------------------------------- /app.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | -------------------------------------------------------------------------------- /netlify.toml: -------------------------------------------------------------------------------- 1 | [build.environment] 2 | NPM_FLAGS = "--version" 3 | NODE_VERSION = "16" 4 | 5 | [build] 6 | publish = "dist" 7 | command = "npx pnpm i --store=node_modules/.pnpm-store && npx pnpm run build" 8 | 9 | [[redirects]] 10 | from = "/*" 11 | to = "/index.html" 12 | status = 200 13 | -------------------------------------------------------------------------------- /composables/count.ts: -------------------------------------------------------------------------------- 1 | export function useCount() { 2 | const count = useState('count', () => Math.round(Math.random() * 20)) 3 | 4 | function inc() { 5 | count.value += 1 6 | } 7 | function dec() { 8 | count.value -= 1 9 | } 10 | 11 | return { 12 | count, 13 | inc, 14 | dec, 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /pages/index.vue: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /components/Footer.vue: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /components/DarkToggle.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /components/PageView.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 14 | -------------------------------------------------------------------------------- /components/Counter.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 18 | -------------------------------------------------------------------------------- /components/Logos.vue: -------------------------------------------------------------------------------- 1 | 21 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "build": "nuxi build", 5 | "dev": "nuxi dev", 6 | "start": "node .output/server/index.mjs", 7 | "lint": "eslint ." 8 | }, 9 | "dependencies": { 10 | "pinia": "^2.0.13" 11 | }, 12 | "devDependencies": { 13 | "@antfu/eslint-config": "^0.20.6", 14 | "@iconify-json/carbon": "^1.1.3", 15 | "@iconify-json/twemoji": "^1.1.3", 16 | "@nuxtjs/color-mode": "^3.0.2", 17 | "@pinia/nuxt": "^0.1.8", 18 | "@unocss/nuxt": "^0.31.5", 19 | "@vueuse/nuxt": "^8.2.6", 20 | "eslint": "^8.13.0", 21 | "nuxt3": "^3.0.0-27501460.04a72f8", 22 | "typescript": "^4.6.3" 23 | }, 24 | "pnpm": { 25 | "overrides": { 26 | "@nuxt/kit": "npm:@nuxt/kit-edge@latest", 27 | "@nuxt/kit-edge": "latest" 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /components/InputEntry.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 39 | -------------------------------------------------------------------------------- /store/user.ts: -------------------------------------------------------------------------------- 1 | import { acceptHMRUpdate, defineStore } from 'pinia' 2 | 3 | export const useUserStore = defineStore('user', () => { 4 | /** 5 | * Current named of the user. 6 | */ 7 | const savedName = ref('') 8 | const previousNames = ref(new Set()) 9 | 10 | const usedNames = computed(() => Array.from(previousNames.value)) 11 | const otherNames = computed(() => usedNames.value.filter(name => name !== savedName.value)) 12 | 13 | /** 14 | * Changes the current name of the user and saves the one that was used 15 | * before. 16 | * 17 | * @param name - new name to set 18 | */ 19 | function setNewName(name: string) { 20 | if (savedName.value) 21 | previousNames.value.add(savedName.value) 22 | 23 | savedName.value = name 24 | } 25 | 26 | return { 27 | setNewName, 28 | otherNames, 29 | savedName, 30 | } 31 | }) 32 | 33 | if (import.meta.hot) 34 | import.meta.hot.accept(acceptHMRUpdate(useUserStore, import.meta.hot)) 35 | -------------------------------------------------------------------------------- /nuxt.config.ts: -------------------------------------------------------------------------------- 1 | import { defineNuxtConfig } from 'nuxt3' 2 | 3 | export default defineNuxtConfig({ 4 | meta: { 5 | title: 'Vitesse Nuxt 3', 6 | link: [ 7 | { 8 | rel: 'icon', type: 'image/png', href: '/nuxt.png', 9 | }, 10 | ], 11 | }, 12 | modules: [ 13 | '@vueuse/nuxt', 14 | '@unocss/nuxt', 15 | '@pinia/nuxt', 16 | '@nuxtjs/color-mode', 17 | ], 18 | autoImports: { 19 | dirs: [ 20 | 'composables', 21 | 'store', 22 | ], 23 | }, 24 | experimental: { 25 | reactivityTransform: true, 26 | // viteNode: true, 27 | }, 28 | vueuse: { 29 | ssrHandlers: true, 30 | }, 31 | unocss: { 32 | uno: true, 33 | attributify: true, 34 | preflight: true, 35 | icons: { 36 | scale: 1.2, 37 | }, 38 | shortcuts: [ 39 | ['btn', 'px-4 py-1 rounded inline-block bg-teal-600 text-white cursor-pointer hover:bg-teal-700 disabled:cursor-default disabled:bg-gray-600 disabled:opacity-50'], 40 | ], 41 | }, 42 | colorMode: { 43 | classSuffix: '', 44 | }, 45 | }) 46 | -------------------------------------------------------------------------------- /pages/hi/[id].vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 |

6 | Vitesse for Nuxt 3 7 |


8 | 9 |
10 | 🧪 Working in Progress
11 | 
12 | 13 |

14 |
15 | 🖥 Online Preview 16 |

17 | 18 |

19 | 20 | ## Features 21 | 22 | - [💚 Nuxt 3](https://v3.nuxtjs.org) - SSR, ESR, File-based routing, components auto importing, modules, etc. 23 | 24 | - ⚡️ Vite - Instant HMR 25 | 26 | - 🎨 [UnoCSS](https://github.com/antfu/unocss) - The instant on-demand atomic CSS engine. 27 | 28 | - 😃 Use icons from any icon sets in Pure CSS, powered by [UnoCSS](https://github.com/antfu/unocss) 29 | 30 | - 🔥 The `