Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: 更好的 DX,更小的输出,增强 seo #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions components.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// generated by unplugin-vue-components
// We suggest you to commit this file into source control
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'

Expand All @@ -12,14 +14,10 @@ declare module '@vue/runtime-core' {
'IconClarity:timesCircleSolid': typeof import('~icons/clarity/times-circle-solid')['default']
'IconClarity:timesLine': typeof import('~icons/clarity/times-line')['default']
'IconFaSolid:ellipsisV': typeof import('~icons/fa-solid/ellipsis-v')['default']
'IconIc:baselineContentCopy': typeof import('~icons/ic/baseline-content-copy')['default']
'IconLa:language': typeof import('~icons/la/language')['default']
'IconMaterialSymbols:contentCopyOutline': typeof import('~icons/material-symbols/content-copy-outline')['default']
'IconMdi:checkCircle': typeof import('~icons/mdi/check-circle')['default']
'IconMdi:githubFace': typeof import('~icons/mdi/github-face')['default']
'IconSimpleIcons:nuxtdotjs': typeof import('~icons/simple-icons/nuxtdotjs')['default']
'IconUil:angleDown': typeof import('~icons/uil/angle-down')['default']
'IconUil:apps': typeof import('~icons/uil/apps')['default']
'IconUil:bars': typeof import('~icons/uil/bars')['default']
'IconUil:clock': typeof import('~icons/uil/clock')['default']
'IconUil:laptop': typeof import('~icons/uil/laptop')['default']
Expand Down
1 change: 1 addition & 0 deletions components/Anchor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const to = toRef(props, 'to')
tag="a"
:to="to"
:class="`transition-colors duration-300 dark:hover:text-white hover:text-gray-900 hover:underline`"
prefetch
>
<slot>{{ text }}</slot>
</NuxtLink>
Expand Down
1 change: 1 addition & 0 deletions components/Builder/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const toggleOptions = (show?: boolean) => {
tag="a"
class="flex-none font-bold mr-3 text-md text-gray-900 w-50 overflow-hidden dark:text-gray-200"
:to="{ name: 'index' }"
prefetch
>
<span class="sr-only">home</span>
<span class="flex items-center">
Expand Down
1 change: 1 addition & 0 deletions components/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const onClick = (event: MouseEvent) => {
tag="a"
:to="to"
:class="`${defaultStyle} ${selectedStyle} ${selectedSize}`"
prefetch
>
<slot>{{ text }}</slot>
</NuxtLink>
Expand Down
49 changes: 28 additions & 21 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export default defineNuxtConfig({
// typescripts
typescript: {
strict: true,
typeCheck: true,
shim: false, // https://nuxt.com.cn/docs/getting-started/installation
// typeCheck: true,
},

// css
Expand All @@ -25,22 +26,23 @@ export default defineNuxtConfig({

// modules
modules: [
'unplugin-icons/nuxt',
'@intlify/nuxt3',
'@pinia/nuxt',
'@nuxt/content',
'@vueuse/nuxt',
'nuxt-windicss',
'@nuxtjs/critters',
'@nuxtjs/fontaine',
[
'unplugin-icons/nuxt',
{
autoInstall: true,
},
],
],

// experimental features
experimental: {
reactivityTransform: false,
},

// auto import components
components: true,

// No sourcemap required in output
sourcemap: false,
// vite plugins
vite: {
plugins: [
Expand Down Expand Up @@ -78,19 +80,24 @@ export default defineNuxtConfig({
},

// windicss
windicss: {
analyze: {
analysis: {
interpretUtilities: false,
},
server: {
port: 4000,
open: false,
},
// windicss: {
// analyze: {
// analysis: {
// interpretUtilities: false,
// },
// server: {
// port: 4000,
// open: false,
// },
// },
// scan: true,
// },

nitro: {
prerender: {
routes: ['/ringrobotx', '/wing', '/about', '/sitemap.xml'],
},
scan: true,
},

// content
content: {
documentDriven: true,
Expand Down
69 changes: 36 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,54 +18,57 @@
"postinstall": "husky install",
"lint": "eslint --ext \".ts,.js,.vue\" --ignore-path .eslintignore .",
"lintfix": "eslint --fix --ext \".ts,.js,.vue\" --ignore-path .eslintignore .",
"prepare": "husky install",
"prepare": "husky install && nuxt prepare",
"clean": "rm -rf .nuxt dist .output",
"generate:locales": "node tools/translator.js ./locales en.yml"
},
"devDependencies": {
"@babel/core": "^7.20.2",
"@commitlint/cli": "^17.2.0",
"@commitlint/config-conventional": "^17.2.0",
"@headlessui/vue": "^1.7.8",
"@iconify/json": "^2.1.135",
"@babel/core": "^7.21.3",
"@commitlint/cli": "^17.4.4",
"@commitlint/config-conventional": "^17.4.4",
"@headlessui/vue": "^1.7.12",
"@iconify-json/clarity": "^1.1.8",
"@iconify-json/mdi": "^1.1.50",
"@intlify/nuxt3": "^0.2.4",
"@nuxt/content": "^2.4.2",
"@nuxt/content": "^2.5.2",
"@nuxt/test-utils-edge": "3.1.1-rc.0-27911047.7d812db",
"@nuxtjs/critters": "^0.4.0",
"@nuxtjs/eslint-config": "^12.0.0",
"@nuxtjs/eslint-config-typescript": "^12.0.0",
"@pinia/nuxt": "^0.4.6",
"@vueuse/core": "^9.11.1",
"@vueuse/nuxt": "^9.11.1",
"eslint": "^8.32.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-nuxt": "^3.2.0",
"@nuxtjs/fontaine": "^0.2.4",
"@pinia/nuxt": "^0.4.7",
"@vueuse/core": "^9.13.0",
"@vueuse/nuxt": "^9.13.0",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.7.0",
"eslint-plugin-nuxt": "^4.0.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.2",
"fontaine": "^0.3.1",
"husky": "^8.0.3",
"js-yaml": "^4.1.0",
"lint-staged": "^13.0.3",
"nuxt": "3.1.1",
"lint-staged": "^13.2.0",
"nuxt": "3.3.1",
"nuxt-windicss": "^2.6.0",
"pinia": "^2.0.29",
"postcss": "8.4.14",
"postcss-loader": "^7.0.0",
"prettier": "^2.7.1",
"sass": "1.53.0",
"sass-loader": "^13.2.0",
"serve": "^13.0.2",
"three": "^0.143.0",
"pinia": "^2.0.33",
"postcss": "8.4.21",
"postcss-loader": "^7.1.0",
"prettier": "^2.8.4",
"sass": "1.59.3",
"sass-loader": "^13.2.1",
"serve": "^14.2.0",
"sitemap": "^7.1.1",
"three": "^0.150.1",
"translate": "^1.4.1",
"typescript": "^4.9.4",
"unplugin-icons": "^0.14.14",
"unplugin-vue-components": "^0.22.9",
"vite": ">=2.9.0 <3.0.0 || >=3.0.0-0 <3.0.0",
"vitest": "^0.28.3",
"vue": "^3.2.41",
"vue-tsc": "^1.0.9",
"webpack": ">=5.0.0 <6.0.0"
"typescript": "^5.0.2",
"unplugin-icons": "^0.15.3",
"unplugin-vue-components": "^0.24.1",
"vite": ">=4.2.0",
"vitest": "^0.29.3",
"vue": "^3.2.47"
},
"lint-staged": {
"**/*.{js,ts,vue,html}": [
"pnpm lintfix"
]
}
}
}
Loading