perf:基础架构升级

This commit is contained in:
刘引
2024-12-03 13:56:17 +08:00
parent 24a01c9bb0
commit d5090f66e2
10 changed files with 1868 additions and 488 deletions

1
auto-imports.d.ts vendored
View File

@@ -3,6 +3,7 @@
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {}
declare global {

View File

@@ -7,10 +7,10 @@
name="viewport"
content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"
/>
<title>Vite App</title>
<title>东风猛士agv配置</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
<!-- <script type="module" src="/src/main.ts"></script> -->
</body>
</html>

View File

@@ -2,28 +2,30 @@
"name": "vue-frame",
"version": "0.0.0",
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview"
"dev": "rsbuild dev",
"build": "rsbuild build",
"preview": "rsbuild preview"
},
"dependencies": {
"axios": "^1.7.2",
"dayjs": "^1.11.11",
"element-plus": "^2.7.3",
"axios": "^1.7.8",
"dayjs": "^1.11.13",
"element-plus": "^2.9.0",
"normalize.css": "^8.0.1",
"pinia": "^2.2.2",
"pinia": "^2.2.8",
"qs": "^6.11.2",
"vue": "^3.4.27",
"vue-router": "^4.3.2"
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},
"devDependencies": {
"@rsbuild/core": "^1.1.7",
"@rsbuild/plugin-sass": "^1.1.1",
"@rsbuild/plugin-vue": "^1.0.5",
"@types/node": "^18.17.1",
"@vitejs/plugin-vue": "^5.0.4",
"sass": "^1.77.2",
"@vitejs/plugin-vue": "^5.2.1",
"sass": "^1.81.1",
"typescript": "^5.0.0",
"unplugin-auto-import": "^0.17.6",
"unplugin-vue-components": "^0.27.0",
"vite": "^5.4.2",
"vue-tsc": "^2.1.4"
"unplugin-auto-import": "^0.18.6",
"unplugin-vue-components": "^0.27.5",
"vue-tsc": "^2.1.10"
}
}

2242
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

36
rsbuild.config.ts Normal file
View File

@@ -0,0 +1,36 @@
import { defineConfig } from '@rsbuild/core'
import { pluginVue } from '@rsbuild/plugin-vue'
import { pluginSass } from '@rsbuild/plugin-sass'
export default defineConfig({
plugins: [pluginVue(), pluginSass()],
html: {
template: './index.html'
},
source: {
entry: {
index: './src/main.ts'
},
alias: {
'@': './src'
}
},
environments: {
web: {
source: {
define: {
'import.meta.env.SSR': JSON.stringify(false)
}
}
},
node: {
source: {
define: {
'import.meta.env.SSR': JSON.stringify(true)
}
},
output: {
target: 'node'
}
}
}
})

View File

@@ -1,11 +1,3 @@
/*
* @Description: {{ByRuin}}
* @Version: 2.0
* @Author: Ruin 🍭
* @Date: 2022-01-25 16:22:24
* @LastEditors: 刘引 liu.yin.work@foxmail.com
* @LastEditTime: 2023-08-01 15:54:28
*/
import { createApp } from 'vue'
import router from './router/index' //引入vue-router
import App from './App.vue'
@@ -21,7 +13,7 @@ createApp(App)
.use(router)
.use(createPinia())
.use(ElementPlus, {
locale: zhCn,
locale: zhCn
})
.component('Foot', Foot)
.component('Head', Head)

View File

@@ -1,11 +1,3 @@
/*
* @Description: {{ByRuin}}
* @Version: 2.0
* @Author: Ruin 🍭
* @Date: 2022-01-25 16:57:54
* @LastEditors: 刘引
* @LastEditTime: 2022-03-11 14:26:24
*/
// import path from 'node:path/win32'
import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [

View File

@@ -23,9 +23,4 @@ const getItem = (data: unknown) => {
data
})
}
const HomeApi = {
getInfo,
getItem
}
export default HomeApi
export { getInfo, getItem }

View File

@@ -8,12 +8,12 @@
<script setup lang="ts">
import { computed, watch, onUpdated, ref, reactive, onBeforeMount } from 'vue'
import news from './components/news.vue'
import HomeApi from '@/services/home'
import { getInfo, getItem } from '@/services/home'
// get请求
const getDataFromApi = async () => {
try {
const res = await HomeApi.getInfo({ type: 'scorpio', time: 'today' })
const res = await getInfo({ type: 'scorpio', time: 'today' })
console.debug(res, '获取到的数据')
} catch (error) {
console.error('get获取星座数据报错', error)

View File

@@ -1,11 +1,3 @@
<!--
* @Description: {{ByRuin}}
* @Version: 2.0
* @Author: Ruin 🍭
* @Date: 2022-03-10 10:11:06
* @LastEditors: 刘引 liu.yin.work@foxmail.com
* @LastEditTime: 2023-08-01 15:45:57
-->
<template>
<div class="root-home">
<news></news>