Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
R
rsbuild-vue3-template
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
曾哲
rsbuild-vue3-template
Commits
f5d9ac8a
提交
f5d9ac8a
authored
12月 30, 2024
作者:
zengzhe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: update
上级
fd0495f5
显示空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
362 行增加
和
341 行删除
+362
-341
.env
.env
+4
-4
.env.development
.env.development
+7
-7
.env.production
.env.production
+13
-6
.env.test
.env.test
+6
-6
pre-commit
.husky/pre-commit
+0
-3
getEnv.ts
build/getEnv.ts
+23
-14
plugins.ts
build/plugins.ts
+0
-98
proxy.ts
build/proxy.ts
+0
-30
rsbuild-plugins.ts
build/rsbuild-plugins.ts
+49
-2
package.json
package.json
+4
-0
pnpm-lock.yaml
pnpm-lock.yaml
+207
-0
rsbuild.config.ts
rsbuild.config.ts
+14
-51
index.ts
src/api/index.ts
+1
-1
index.vue
src/components/PwdRisk/index.vue
+2
-2
env.d.ts
src/env.d.ts
+18
-11
index.ts
src/routers/index.ts
+1
-1
global.d.ts
src/typings/global.d.ts
+11
-13
index.vue
src/views/login/index.vue
+2
-4
tsconfig.json
tsconfig.json
+0
-1
vite.config.ts
vite.config.ts
+0
-87
没有找到文件。
.env
浏览文件 @
f5d9ac8a
# title
# title
VITE
_GLOB_APP_TITLE = '智慧教育后台管理系统'
PUBLIC
_GLOB_APP_TITLE = '智慧教育后台管理系统'
# 本地运行端口号
# 本地运行端口号
VITE
_PORT = 5173
PUBLIC
_PORT = 5173
# 启动时自动打开浏览器
# 启动时自动打开浏览器
VITE
_OPEN = false
PUBLIC
_OPEN = false
# 打包后是否生成包分析文件
# 打包后是否生成包分析文件
VITE
_REPORT = false
PUBLIC
_REPORT = false
.env.development
浏览文件 @
f5d9ac8a
...
@@ -7,22 +7,22 @@
...
@@ -7,22 +7,22 @@
# Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
# Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
###
###
# 本地环境
# 本地环境
VITE
_USER_NODE_ENV = development
PUBLIC
_USER_NODE_ENV = development
# 公共基础路径
# 公共基础路径
VITE
_PUBLIC_PATH = /
PUBLIC
_PUBLIC_PATH = /
# 打包时是否删除 console
# 打包时是否删除 console
VITE
_DROP_CONSOLE = true
PUBLIC
_DROP_CONSOLE = true
# 开发环境接口地址
# 开发环境接口地址
VITE
_API_URL = http://api.iep.casdio.com
PUBLIC
_API_URL = http://api.iep.casdio.com
# 汪洋
# 汪洋
#
VITE
_API_URL = http://172.16.3.197:8095
#
PUBLIC
_API_URL = http://172.16.3.197:8095
# 邹琪涛
# 邹琪涛
#
VITE
_API_URL = https://e28e-14-105-62-130.ngrok-free.app
#
PUBLIC
_API_URL = https://e28e-14-105-62-130.ngrok-free.app
# 开发环境跨域代理,支持配置多个
# 开发环境跨域代理,支持配置多个
VITE
_PROXY = []
PUBLIC
_PROXY = []
.env.production
浏览文件 @
f5d9ac8a
###
# @Author: zengzhe
# @Date: 2024-12-27 11:15:21
# @LastEditors: zengzhe
# @LastEditTime: 2024-12-27 14:53:30
# @Description:
###
# 线上环境
# 线上环境
VITE
_USER_NODE_ENV = production
PUBLIC
_USER_NODE_ENV = production
# 公共基础路径
# 公共基础路径
VITE
_PUBLIC_PATH = /
PUBLIC
_PUBLIC_PATH = /
# 是否启用 gzip 或 brotli 压缩打包,如果需要多个压缩规则,可以使用 “,” 分隔
# 是否启用 gzip 或 brotli 压缩打包,如果需要多个压缩规则,可以使用 “,” 分隔
# Optional: gzip | brotli | none
# Optional: gzip | brotli | none
VITE
_BUILD_COMPRESS = none
PUBLIC
_BUILD_COMPRESS = none
# 打包压缩后是否删除源文件
# 打包压缩后是否删除源文件
VITE
_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
PUBLIC
_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
# 打包时是否删除 console
# 打包时是否删除 console
VITE
_DROP_CONSOLE = true
PUBLIC
_DROP_CONSOLE = true
# 线上环境接口地址
# 线上环境接口地址
VITE
_API_URL = "https://api.iep.seevin.com"
PUBLIC
_API_URL = "https://api.iep.seevin.com"
.env.test
浏览文件 @
f5d9ac8a
...
@@ -7,20 +7,20 @@
...
@@ -7,20 +7,20 @@
# Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
# Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
###
###
# 测试环境
# 测试环境
VITE
_USER_NODE_ENV
=
test
PUBLIC
_USER_NODE_ENV
=
test
# 公共基础路径
# 公共基础路径
VITE
_PUBLIC_PATH
=
/
PUBLIC
_PUBLIC_PATH
=
/
# 是否启用 gzip 或 brotli 压缩打包,如果需要多个压缩规则,可以使用 “,” 分隔
# 是否启用 gzip 或 brotli 压缩打包,如果需要多个压缩规则,可以使用 “,” 分隔
# Optional: gzip | brotli | none
# Optional: gzip | brotli | none
VITE
_BUILD_COMPRESS
=
none
PUBLIC
_BUILD_COMPRESS
=
none
# 打包压缩后是否删除源文件
# 打包压缩后是否删除源文件
VITE
_BUILD_COMPRESS_DELETE_ORIGIN_FILE
=
false
PUBLIC
_BUILD_COMPRESS_DELETE_ORIGIN_FILE
=
false
# 打包时是否删除 console
# 打包时是否删除 console
VITE
_DROP_CONSOLE
=
true
PUBLIC
_DROP_CONSOLE
=
true
# 测试环境接口地址
# 测试环境接口地址
VITE
_API_URL
=
http
://
api
.
iep
.
casdio
.
com
PUBLIC
_API_URL
=
http
://
api
.
iep
.
casdio
.
com
.husky/pre-commit
浏览文件 @
f5d9ac8a
#!/usr/bin/env sh
.
"
$(
dirname
--
"
$0
"
)
/_/husky.sh"
npm run lint-staged
npm run lint-staged
build/getEnv.ts
浏览文件 @
f5d9ac8a
/*
/*
* @Author: zhanyoulin<zhanyoulin456@163.com>
* @Author: zhanyoulin<zhanyoulin456@163.com>
* @Date: 2023-06-23 11:04:27
* @Date: 2023-06-23 11:04:27
* @LastEditors: z
hanyoulin
* @LastEditors: z
engzhe
* @LastEditTime: 202
3-06-23 13:49:05
* @LastEditTime: 202
4-12-27 15:27:57
* @Description:
* @Description:
*/
*/
import
path
from
'path'
import
path
from
'path'
...
@@ -23,25 +23,34 @@ export function isTestFn(mode: string): boolean {
...
@@ -23,25 +23,34 @@ export function isTestFn(mode: string): boolean {
* Whether to generate package preview
* Whether to generate package preview
*/
*/
export
function
isReportMode
():
boolean
{
export
function
isReportMode
():
boolean
{
return
process
.
env
.
VITE
_REPORT
===
'true'
return
process
.
env
.
PUBLIC
_REPORT
===
'true'
}
}
// Read all environment variable configuration files to process.env
// Read all environment variable configuration files to process.env
export
function
wrapperEnv
(
envConf
:
Recordable
):
ViteEnv
{
export
function
wrapperEnv
(
envConf
:
Recordable
):
Recordable
{
const
ret
:
any
=
{}
const
ret
:
Recordable
=
{}
for
(
const
envName
of
Object
.
keys
(
envConf
))
{
for
(
const
envName
of
Object
.
keys
(
envConf
))
{
let
realName
=
envConf
[
envName
].
replace
(
/
\\
n/g
,
'
\
n'
)
// 只处理 process.env 开头的配置
realName
=
realName
===
'true'
?
true
:
realName
===
'false'
?
false
:
realName
if
(
envName
.
startsWith
(
'process.env.'
))
{
if
(
envName
===
'VITE_PORT'
)
realName
=
Number
(
realName
)
// 移除 process.env. 前缀
if
(
envName
===
'VITE_PROXY'
)
{
const
key
=
envName
.
replace
(
'process.env.'
,
''
)
try
{
// 移除值两端的引号
realName
=
JSON
.
parse
(
realName
)
let
value
=
envConf
[
envName
].
replace
(
/^
[
"'
](
.+
)[
"'
]
$/
,
'$1'
)
}
catch
(
error
)
{
console
.
log
(
error
)
// 转换特定类型的值
value
=
value
===
'true'
?
true
:
value
===
'false'
?
false
:
value
if
(
value
===
'null'
)
{
value
=
null
}
}
if
(
!
isNaN
(
Number
(
value
)))
{
value
=
Number
(
value
)
}
ret
[
key
]
=
value
}
}
ret
[
envName
]
=
realName
}
}
return
ret
return
ret
}
}
...
...
build/plugins.ts
deleted
100644 → 0
浏览文件 @
fd0495f5
import
{
resolve
}
from
'path'
import
{
PluginOption
}
from
'vite'
import
{
visualizer
}
from
'rollup-plugin-visualizer'
import
{
createHtmlPlugin
}
from
'vite-plugin-html'
import
{
createSvgIconsPlugin
}
from
'vite-plugin-svg-icons'
import
vue
from
'@vitejs/plugin-vue'
import
vueJsx
from
'@vitejs/plugin-vue-jsx'
import
viteCompression
from
'vite-plugin-compression'
import
Components
from
'unplugin-vue-components/vite'
import
AutoImport
from
'unplugin-auto-import/vite'
import
{
TDesignResolver
}
from
'unplugin-vue-components/resolvers'
import
legacy
from
'@vitejs/plugin-legacy'
// polyfill低版本谷歌浏览器
import
checker
from
'vite-plugin-checker'
/**
* 创建 vite 插件
* @param viteEnv
*/
export
const
createVitePlugins
=
(
viteEnv
:
ViteEnv
):
(
PluginOption
|
PluginOption
[])[]
=>
{
const
{
VITE_GLOB_APP_TITLE
,
VITE_REPORT
}
=
viteEnv
return
[
vue
(),
// vue 可以使用 jsx/tsx 语法
vueJsx
(),
// 创建打包压缩配置
createCompression
(
viteEnv
),
// eslintPlugin(),
// 注入变量到 html 文件
createHtmlPlugin
({
inject
:
{
data
:
{
title
:
VITE_GLOB_APP_TITLE
}
}
}),
// 使用 svg 图标
createSvgIconsPlugin
({
iconDirs
:
[
resolve
(
process
.
cwd
(),
'src/assets/icons'
)],
symbolId
:
'icon-[dir]-[name]'
}),
// 是否生成包预览,分析依赖包大小做优化处理
VITE_REPORT
&&
(
visualizer
({
filename
:
'stats.html'
,
gzipSize
:
true
,
brotliSize
:
true
})
as
PluginOption
),
AutoImport
({
imports
:
[
'vue'
,
'vue-router'
],
resolvers
:
[
TDesignResolver
({
library
:
'vue-next'
})
],
dts
:
'src/autoImport.d.ts'
}),
Components
({
// allow auto load markdown components under `./src/components/`
extensions
:
[
'vue'
,
'md'
],
// allow auto import and register components used in markdown
include
:
[
/
\.
vue$/
,
/
\.
vue
\?
vue/
,
/
\.
md$/
],
resolvers
:
[
TDesignResolver
({
library
:
'vue-next'
})
],
dts
:
'src/components.d.ts'
}),
legacy
({
targets
:
[
'defaults'
,
'not IE 11'
,
'chrome 68'
]
}),
checker
({
typescript
:
true
})
]
}
/**
* @description 根据 compress 配置,生成不同的压缩规则
* @param viteEnv
*/
const
createCompression
=
(
viteEnv
:
ViteEnv
):
PluginOption
|
PluginOption
[]
=>
{
const
{
VITE_BUILD_COMPRESS
=
'none'
,
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE
}
=
viteEnv
const
compressList
=
VITE_BUILD_COMPRESS
.
split
(
','
)
const
plugins
:
PluginOption
[]
=
[]
if
(
compressList
.
includes
(
'gzip'
))
{
plugins
.
push
(
viteCompression
({
ext
:
'.gz'
,
algorithm
:
'gzip'
,
deleteOriginFile
:
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE
})
)
}
if
(
compressList
.
includes
(
'brotli'
))
{
plugins
.
push
(
viteCompression
({
ext
:
'.br'
,
algorithm
:
'brotliCompress'
,
deleteOriginFile
:
VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE
})
)
}
return
plugins
}
build/proxy.ts
deleted
100644 → 0
浏览文件 @
fd0495f5
import
type
{
ProxyOptions
}
from
'vite'
type
ProxyItem
=
[
string
,
string
]
type
ProxyList
=
ProxyItem
[]
type
ProxyTargetList
=
Record
<
string
,
ProxyOptions
>
/**
* 创建代理,用于解析 .env.development 代理配置
* @param list
*/
export
function
createProxy
(
list
:
ProxyList
=
[])
{
const
ret
:
ProxyTargetList
=
{}
for
(
const
[
prefix
,
target
]
of
list
)
{
const
httpsRE
=
/^https:
\/\/
/
const
isHttps
=
httpsRE
.
test
(
target
)
// https://github.com/http-party/node-http-proxy#options
ret
[
prefix
]
=
{
target
:
target
,
changeOrigin
:
true
,
ws
:
true
,
rewrite
:
path
=>
path
.
replace
(
new
RegExp
(
`^
${
prefix
}
`
),
''
),
// https is require secure=false
...(
isHttps
?
{
secure
:
false
}
:
{})
}
}
return
ret
}
build/rsbuild-plugins.ts
浏览文件 @
f5d9ac8a
/*
* @Author: zengzhe
* @Date: 2024-12-27 11:54:24
* @LastEditors: zengzhe
* @LastEditTime: 2024-12-27 17:00:00
* @Description:
*/
import
{
pluginBabel
}
from
'@rsbuild/plugin-babel'
import
{
pluginBabel
}
from
'@rsbuild/plugin-babel'
import
{
pluginVue
}
from
'@rsbuild/plugin-vue'
import
{
pluginVue
}
from
'@rsbuild/plugin-vue'
import
{
pluginVueJsx
}
from
'@rsbuild/plugin-vue-jsx'
import
{
pluginVueJsx
}
from
'@rsbuild/plugin-vue-jsx'
import
{
pluginLess
}
from
'@rsbuild/plugin-less'
import
{
pluginLess
}
from
'@rsbuild/plugin-less'
import
{
pluginTypeCheck
}
from
'@rsbuild/plugin-type-check'
import
{
pluginSvgSpriteLoader
}
from
'rsbuild-plugin-svg-sprite-loader'
import
AutoImport
from
'unplugin-auto-import/rspack'
import
Components
from
'unplugin-vue-components/rspack'
import
{
TDesignResolver
}
from
'unplugin-vue-components/resolvers'
import
{
join
}
from
'path'
export
const
createPlugins
=
()
=>
{
export
const
createPlugins
=
()
=>
{
return
[
return
{
plugins
:
[
pluginBabel
({
pluginBabel
({
include
:
/
\.(?:
jsx|tsx
)
$/
include
:
/
\.(?:
jsx|tsx
)
$/
}),
}),
pluginVue
(),
pluginVue
(),
pluginVueJsx
(),
pluginVueJsx
(),
pluginLess
()
pluginLess
(),
pluginTypeCheck
(),
pluginSvgSpriteLoader
({
path
:
join
(
__dirname
,
'../src/assets/icons'
),
symbolId
:
'icon-[name]'
})
],
tools
:
{
rspack
:
{
plugins
:
[
AutoImport
({
imports
:
[
'vue'
,
'vue-router'
],
resolvers
:
[
TDesignResolver
({
library
:
'vue-next'
})
],
dts
:
'src/autoImport.d.ts'
}),
Components
({
// allow auto load markdown components under `./src/components/`
extensions
:
[
'vue'
,
'md'
],
// allow auto import and register components used in markdown
include
:
[
/
\.
vue$/
,
/
\.
vue
\?
vue/
,
/
\.
md$/
],
resolvers
:
[
TDesignResolver
({
library
:
'vue-next'
})
],
dts
:
'src/components.d.ts'
})
]
]
}
}
}
}
}
package.json
浏览文件 @
f5d9ac8a
...
@@ -55,6 +55,7 @@
...
@@ -55,6 +55,7 @@
"
@rsbuild/core
"
:
"^1.1.13"
,
"
@rsbuild/core
"
:
"^1.1.13"
,
"
@rsbuild/plugin-babel
"
:
"^1.0.3"
,
"
@rsbuild/plugin-babel
"
:
"^1.0.3"
,
"
@rsbuild/plugin-less
"
:
"^1.1.0"
,
"
@rsbuild/plugin-less
"
:
"^1.1.0"
,
"
@rsbuild/plugin-type-check
"
:
"^1.2.0"
,
"
@rsbuild/plugin-vue
"
:
"^1.0.5"
,
"
@rsbuild/plugin-vue
"
:
"^1.0.5"
,
"
@rsbuild/plugin-vue-jsx
"
:
"^1.1.0"
,
"
@rsbuild/plugin-vue-jsx
"
:
"^1.1.0"
,
"
@rushstack/eslint-patch
"
:
"^1.8.0"
,
"
@rushstack/eslint-patch
"
:
"^1.8.0"
,
...
@@ -75,6 +76,9 @@
...
@@ -75,6 +76,9 @@
"
postcss-less
"
:
"^6.0.0"
,
"
postcss-less
"
:
"^6.0.0"
,
"
prettier
"
:
"^3.3.3"
,
"
prettier
"
:
"^3.3.3"
,
"
rollup-plugin-visualizer
"
:
"^5.12.0"
,
"
rollup-plugin-visualizer
"
:
"^5.12.0"
,
"
rsbuild-plugin-svg
"
:
"^0.0.2"
,
"
rsbuild-plugin-svg-sprite-loader
"
:
"^0.0.2"
,
"
rsbuild-svg-sprite-loader
"
:
"^0.0.1"
,
"
stylelint
"
:
"~16.2.1"
,
"
stylelint
"
:
"~16.2.1"
,
"
stylelint-config-standard
"
:
"^36.0.0"
,
"
stylelint-config-standard
"
:
"^36.0.0"
,
"
stylelint-order
"
:
"~6.0.4"
,
"
stylelint-order
"
:
"~6.0.4"
,
...
...
pnpm-lock.yaml
浏览文件 @
f5d9ac8a
...
@@ -76,6 +76,9 @@ devDependencies:
...
@@ -76,6 +76,9 @@ devDependencies:
'
@rsbuild/plugin-less'
:
'
@rsbuild/plugin-less'
:
specifier
:
^1.1.0
specifier
:
^1.1.0
version
:
1.1.0(@rsbuild/core@1.1.13)
version
:
1.1.0(@rsbuild/core@1.1.13)
'
@rsbuild/plugin-type-check'
:
specifier
:
^1.2.0
version
:
1.2.0(@rsbuild/core@1.1.13)(typescript@5.6.2)
'
@rsbuild/plugin-vue'
:
'
@rsbuild/plugin-vue'
:
specifier
:
^1.0.5
specifier
:
^1.0.5
version
:
1.0.5(@rsbuild/core@1.1.13)(vue@3.5.13)
version
:
1.0.5(@rsbuild/core@1.1.13)(vue@3.5.13)
...
@@ -136,6 +139,15 @@ devDependencies:
...
@@ -136,6 +139,15 @@ devDependencies:
rollup-plugin-visualizer
:
rollup-plugin-visualizer
:
specifier
:
^5.12.0
specifier
:
^5.12.0
version
:
5.12.0
version
:
5.12.0
rsbuild-plugin-svg
:
specifier
:
^0.0.2
version
:
0.0.2(@rsbuild/core@1.1.13)(vue@3.5.13)
rsbuild-plugin-svg-sprite-loader
:
specifier
:
^0.0.2
version
:
0.0.2(@rsbuild/core@1.1.13)
rsbuild-svg-sprite-loader
:
specifier
:
^0.0.1
version
:
0.0.1(@rsbuild/core@1.1.13)
stylelint
:
stylelint
:
specifier
:
~16.2.1
specifier
:
~16.2.1
version
:
16.2.1(typescript@5.6.2)
version
:
16.2.1(typescript@5.6.2)
...
@@ -805,6 +817,37 @@ packages:
...
@@ -805,6 +817,37 @@ packages:
'
@jridgewell/sourcemap-codec'
:
1.5.0
'
@jridgewell/sourcemap-codec'
:
1.5.0
dev
:
true
dev
:
true
/@jsonjoy.com/base64@1.1.2(tslib@2.8.1)
:
resolution
:
{
integrity
:
sha512-q6XAnWQDIMA3+FTiOYajoYqySkO+JSat0ytXGSuRdq9uXE7o92gzuQwQM14xaCRlBLGq3v5miDGC4vkVTn54xA==
}
engines
:
{
node
:
'
>=10.0'
}
peerDependencies
:
tslib
:
'
2'
dependencies
:
tslib
:
2.8.1
dev
:
true
/@jsonjoy.com/json-pack@1.1.1(tslib@2.8.1)
:
resolution
:
{
integrity
:
sha512-osjeBqMJ2lb/j/M8NCPjs1ylqWIcTRTycIhVB5pt6LgzgeRSb0YRZ7j9RfA8wIUrsr/medIuhVyonXRZWLyfdw==
}
engines
:
{
node
:
'
>=10.0'
}
peerDependencies
:
tslib
:
'
2'
dependencies
:
'
@jsonjoy.com/base64'
:
1.1.2(tslib@2.8.1)
'
@jsonjoy.com/util'
:
1.5.0(tslib@2.8.1)
hyperdyperid
:
1.2.0
thingies
:
1.21.0(tslib@2.8.1)
tslib
:
2.8.1
dev
:
true
/@jsonjoy.com/util@1.5.0(tslib@2.8.1)
:
resolution
:
{
integrity
:
sha512-ojoNsrIuPI9g6o8UxhraZQSyF2ByJanAY4cTFbc8Mf2AXEF4aQRGY1dJxyJpuyav8r9FGflEt/Ff3u5Nt6YMPA==
}
engines
:
{
node
:
'
>=10.0'
}
peerDependencies
:
tslib
:
'
2'
dependencies
:
tslib
:
2.8.1
dev
:
true
/@module-federation/runtime-tools@0.5.1
:
/@module-federation/runtime-tools@0.5.1
:
resolution
:
{
integrity
:
sha512-nfBedkoZ3/SWyO0hnmaxuz0R0iGPSikHZOAZ0N/dVSQaIzlffUo35B5nlC2wgWIc0JdMZfkwkjZRrnuuDIJbzg==
}
resolution
:
{
integrity
:
sha512-nfBedkoZ3/SWyO0hnmaxuz0R0iGPSikHZOAZ0N/dVSQaIzlffUo35B5nlC2wgWIc0JdMZfkwkjZRrnuuDIJbzg==
}
dependencies
:
dependencies
:
...
@@ -919,6 +962,24 @@ packages:
...
@@ -919,6 +962,24 @@ packages:
reduce-configs
:
1.1.0
reduce-configs
:
1.1.0
dev
:
true
dev
:
true
/@rsbuild/plugin-type-check@1.2.0(@rsbuild/core@1.1.13)(typescript@5.6.2)
:
resolution
:
{
integrity
:
sha512-bx+WmtK7K5Jc07IQn2cBDqcP/Kt98u16NiW3EyxqJGhQ1OgFvK6ewc70+AJnBvtjE+MMB70NAXEl8MNOtSxz6g==
}
peerDependencies
:
'
@rsbuild/core'
:
1.x
peerDependenciesMeta
:
'
@rsbuild/core'
:
optional
:
true
dependencies
:
'
@rsbuild/core'
:
1.1.13
deepmerge
:
4.3.1
json5
:
2.2.3
reduce-configs
:
1.1.0
ts-checker-rspack-plugin
:
1.1.0(typescript@5.6.2)
transitivePeerDependencies
:
-
'
@rspack/core'
-
typescript
dev
:
true
/@rsbuild/plugin-vue-jsx@1.1.0(@babel/core@7.26.0)(@rsbuild/core@1.1.13)
:
/@rsbuild/plugin-vue-jsx@1.1.0(@babel/core@7.26.0)(@rsbuild/core@1.1.13)
:
resolution
:
{
integrity
:
sha512-ZvYXPs00bG5mMhAFsJ5cVbHgF7Kz+rRpMlRHOJQhKGihFEiUK1Wx8Qfmn5ZrMBIgIGp0BaOnHoGSPH7fVQikCA==
}
resolution
:
{
integrity
:
sha512-ZvYXPs00bG5mMhAFsJ5cVbHgF7Kz+rRpMlRHOJQhKGihFEiUK1Wx8Qfmn5ZrMBIgIGp0BaOnHoGSPH7fVQikCA==
}
peerDependencies
:
peerDependencies
:
...
@@ -1078,6 +1139,11 @@ packages:
...
@@ -1078,6 +1139,11 @@ packages:
resolution
:
{
integrity
:
sha512-VeJbUb0wEKbcwaSlj5n+LscBl9IPgLPkHVGBkh00cztv6X4L/TJXK58LzFuBKX7/GAfiGhIwH67YTLTlzvIzBA==
}
resolution
:
{
integrity
:
sha512-VeJbUb0wEKbcwaSlj5n+LscBl9IPgLPkHVGBkh00cztv6X4L/TJXK58LzFuBKX7/GAfiGhIwH67YTLTlzvIzBA==
}
dev
:
false
dev
:
false
/@trysound/sax@0.2.0
:
resolution
:
{
integrity
:
sha512-L7z9BgrNEcYyUYtF+HaEfiS5ebkh9jXqbszz7pC0hRBPaatV0XjSD3+eHrpqFemQfgwiFF0QPIarnIihIDn7OA==
}
engines
:
{
node
:
'
>=10.13.0'
}
dev
:
true
/@types/babel__core@7.20.5
:
/@types/babel__core@7.20.5
:
resolution
:
{
integrity
:
sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==
}
resolution
:
{
integrity
:
sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==
}
dependencies
:
dependencies
:
...
@@ -2228,6 +2294,11 @@ packages:
...
@@ -2228,6 +2294,11 @@ packages:
engines
:
{
node
:
'
>=
6'
}
engines
:
{
node
:
'
>=
6'
}
dev
:
true
dev
:
true
/commander@7.2.0
:
resolution
:
{
integrity
:
sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==
}
engines
:
{
node
:
'
>=
10'
}
dev
:
true
/compare-func@2.0.0
:
/compare-func@2.0.0
:
resolution
:
{
integrity
:
sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==
}
resolution
:
{
integrity
:
sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==
}
dependencies
:
dependencies
:
...
@@ -2335,6 +2406,24 @@ packages:
...
@@ -2335,6 +2406,24 @@ packages:
engines
:
{
node
:
'
>=12
||
>=16'
}
engines
:
{
node
:
'
>=12
||
>=16'
}
dev
:
true
dev
:
true
/css-select@5.1.0
:
resolution
:
{
integrity
:
sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==
}
dependencies
:
boolbase
:
1.0.0
css-what
:
6.1.0
domhandler
:
5.0.3
domutils
:
3.1.0
nth-check
:
2.1.1
dev
:
true
/css-tree@2.2.1
:
resolution
:
{
integrity
:
sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==
}
engines
:
{
node
:
^10 || ^12.20.0 || ^14.13.0 || >=15.0.0
,
npm
:
'
>=7.0.0'
}
dependencies
:
mdn-data
:
2.0.28
source-map-js
:
1.2.1
dev
:
true
/css-tree@2.3.1
:
/css-tree@2.3.1
:
resolution
:
{
integrity
:
sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==
}
resolution
:
{
integrity
:
sha512-6Fv1DV/TYw//QF5IzQdqsNDjx/wc8TrMBZsqjL9eW01tWb7R7k/mq+/VXfJCl7SoD5emsJop9cOByJZfs8hYIw==
}
engines
:
{
node
:
^10 || ^12.20.0 || ^14.13.0 || >=15.0.0
}
engines
:
{
node
:
^10 || ^12.20.0 || ^14.13.0 || >=15.0.0
}
...
@@ -2343,12 +2432,24 @@ packages:
...
@@ -2343,12 +2432,24 @@ packages:
source-map-js
:
1.2.1
source-map-js
:
1.2.1
dev
:
true
dev
:
true
/css-what@6.1.0
:
resolution
:
{
integrity
:
sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==
}
engines
:
{
node
:
'
>=
6'
}
dev
:
true
/cssesc@3.0.0
:
/cssesc@3.0.0
:
resolution
:
{
integrity
:
sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==
}
resolution
:
{
integrity
:
sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==
}
engines
:
{
node
:
'
>=4'
}
engines
:
{
node
:
'
>=4'
}
hasBin
:
true
hasBin
:
true
dev
:
true
dev
:
true
/csso@5.0.5
:
resolution
:
{
integrity
:
sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==
}
engines
:
{
node
:
^10 || ^12.20.0 || ^14.13.0 || >=15.0.0
,
npm
:
'
>=7.0.0'
}
dependencies
:
css-tree
:
2.2.1
dev
:
true
/csstype@3.1.3
:
/csstype@3.1.3
:
resolution
:
{
integrity
:
sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==
}
resolution
:
{
integrity
:
sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==
}
...
@@ -3194,6 +3295,11 @@ packages:
...
@@ -3194,6 +3295,11 @@ packages:
hasBin
:
true
hasBin
:
true
dev
:
true
dev
:
true
/hyperdyperid@1.2.0
:
resolution
:
{
integrity
:
sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==
}
engines
:
{
node
:
'
>=10.18'
}
dev
:
true
/i18next@20.6.1
:
/i18next@20.6.1
:
resolution
:
{
integrity
:
sha512-yCMYTMEJ9ihCwEQQ3phLo7I/Pwycf8uAx+sRHwwk5U9Aui/IZYgQRyMqXafQOw5QQ7DM1Z+WyEXWIqSuJHhG2A==
}
resolution
:
{
integrity
:
sha512-yCMYTMEJ9ihCwEQQ3phLo7I/Pwycf8uAx+sRHwwk5U9Aui/IZYgQRyMqXafQOw5QQ7DM1Z+WyEXWIqSuJHhG2A==
}
dependencies
:
dependencies
:
...
@@ -3667,10 +3773,24 @@ packages:
...
@@ -3667,10 +3773,24 @@ packages:
resolution
:
{
integrity
:
sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==
}
resolution
:
{
integrity
:
sha512-APMBEanjybaPzUrfqU0IMU5I0AswKMH7k8OTLs0vvV4KZpExkTkY87nR/zpbuTPj+gARop7aGUbl11pnDfW6xg==
}
dev
:
true
dev
:
true
/mdn-data@2.0.28
:
resolution
:
{
integrity
:
sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==
}
dev
:
true
/mdn-data@2.0.30
:
/mdn-data@2.0.30
:
resolution
:
{
integrity
:
sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==
}
resolution
:
{
integrity
:
sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==
}
dev
:
true
dev
:
true
/memfs@4.15.1
:
resolution
:
{
integrity
:
sha512-ufCzgFwiVnR6R9cCYuvwznJdhdYXEvFl0hpnM4cCtVaVkHuqBR+6fo2sqt1SSMdp+uiHw9GyPZr3OMM5tqjSmQ==
}
engines
:
{
node
:
'
>=
4.0.0'
}
dependencies
:
'
@jsonjoy.com/json-pack'
:
1.1.1(tslib@2.8.1)
'
@jsonjoy.com/util'
:
1.5.0(tslib@2.8.1)
tree-dump
:
1.0.2(tslib@2.8.1)
tslib
:
2.8.1
dev
:
true
/meow@12.1.1
:
/meow@12.1.1
:
resolution
:
{
integrity
:
sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==
}
resolution
:
{
integrity
:
sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==
}
engines
:
{
node
:
'
>=16.10'
}
engines
:
{
node
:
'
>=16.10'
}
...
@@ -4350,6 +4470,42 @@ packages:
...
@@ -4350,6 +4470,42 @@ packages:
yargs
:
17.7.2
yargs
:
17.7.2
dev
:
true
dev
:
true
/rsbuild-plugin-svg-sprite-loader@0.0.2(@rsbuild/core@1.1.13)
:
resolution
:
{
integrity
:
sha512-xbJLTMpFzgia176mDoXOL22gUQ3nqmvo9CyrI4aiFpW5dU00EUd4HLF5pnO+lMVpAHOIPgBvzbafCkhBu9GR7w==
}
peerDependencies
:
'
@rsbuild/core'
:
1.x || ^1.0.1-beta.0
peerDependenciesMeta
:
'
@rsbuild/core'
:
optional
:
true
dependencies
:
'
@rsbuild/core'
:
1.1.13
dev
:
true
/rsbuild-plugin-svg@0.0.2(@rsbuild/core@1.1.13)(vue@3.5.13)
:
resolution
:
{
integrity
:
sha512-W1RNPNc2QdZz0dfwD5qKtIeo3/gVsfEDuLlgwf91xHiUvzMEkYXJbaupyhJgLNXfsSMXUNFzZApdt4cI/zd7Qw==
}
peerDependencies
:
'
@rsbuild/core'
:
1.x || ^1.0.1-beta.0
vue
:
^3.5.12
peerDependenciesMeta
:
'
@rsbuild/core'
:
optional
:
true
dependencies
:
'
@rsbuild/core'
:
1.1.13
svgo
:
3.3.2
vue
:
3.5.13(typescript@5.6.2)
dev
:
true
/rsbuild-svg-sprite-loader@0.0.1(@rsbuild/core@1.1.13)
:
resolution
:
{
integrity
:
sha512-4Q85wVQyHLIxgk80gNhO18OOwyWebWXQfGAlzLpjkMmPWJWqhN/5bc6mlLQk3j7zDnHA3gSRPbz+wvb/eylV0w==
}
peerDependencies
:
'
@rsbuild/core'
:
1.x || ^1.0.1-beta.0
peerDependenciesMeta
:
'
@rsbuild/core'
:
optional
:
true
dependencies
:
'
@rsbuild/core'
:
1.1.13
dev
:
true
/run-parallel@1.2.0
:
/run-parallel@1.2.0
:
resolution
:
{
integrity
:
sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==
}
resolution
:
{
integrity
:
sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==
}
dependencies
:
dependencies
:
...
@@ -4739,6 +4895,20 @@ packages:
...
@@ -4739,6 +4895,20 @@ packages:
resolution
:
{
integrity
:
sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==
}
resolution
:
{
integrity
:
sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==
}
dev
:
true
dev
:
true
/svgo@3.3.2
:
resolution
:
{
integrity
:
sha512-OoohrmuUlBs8B8o6MB2Aevn+pRIH9zDALSR+6hhqVfa6fRwG/Qw9VUMSMW9VNg2CFc/MTIfabtdOVl9ODIJjpw==
}
engines
:
{
node
:
'
>=14.0.0'
}
hasBin
:
true
dependencies
:
'
@trysound/sax'
:
0.2.0
commander
:
7.2.0
css-select
:
5.1.0
css-tree
:
2.3.1
css-what
:
6.1.0
csso
:
5.0.5
picocolors
:
1.1.1
dev
:
true
/synckit@0.9.2
:
/synckit@0.9.2
:
resolution
:
{
integrity
:
sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==
}
resolution
:
{
integrity
:
sha512-vrozgXDQwYO72vHjUb/HnFbQx1exDjoKzqx23aXEg2a9VIg2TSFZ8FmeZpTjUCFMYw7mpX4BE2SFu8wI7asYsw==
}
engines
:
{
node
:
^14.18.0 || >=16.0.0
}
engines
:
{
node
:
^14.18.0 || >=16.0.0
}
...
@@ -4881,6 +5051,15 @@ packages:
...
@@ -4881,6 +5051,15 @@ packages:
any-promise
:
1.3.0
any-promise
:
1.3.0
dev
:
true
dev
:
true
/thingies@1.21.0(tslib@2.8.1)
:
resolution
:
{
integrity
:
sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g==
}
engines
:
{
node
:
'
>=10.18'
}
peerDependencies
:
tslib
:
^2
dependencies
:
tslib
:
2.8.1
dev
:
true
/through@2.3.8
:
/through@2.3.8
:
resolution
:
{
integrity
:
sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==
}
resolution
:
{
integrity
:
sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==
}
dev
:
true
dev
:
true
...
@@ -4912,6 +5091,15 @@ packages:
...
@@ -4912,6 +5091,15 @@ packages:
is-number
:
7.0.0
is-number
:
7.0.0
dev
:
true
dev
:
true
/tree-dump@1.0.2(tslib@2.8.1)
:
resolution
:
{
integrity
:
sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ==
}
engines
:
{
node
:
'
>=10.0'
}
peerDependencies
:
tslib
:
'
2'
dependencies
:
tslib
:
2.8.1
dev
:
true
/ts-api-utils@1.4.3(typescript@5.6.2)
:
/ts-api-utils@1.4.3(typescript@5.6.2)
:
resolution
:
{
integrity
:
sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==
}
resolution
:
{
integrity
:
sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==
}
engines
:
{
node
:
'
>=16'
}
engines
:
{
node
:
'
>=16'
}
...
@@ -4921,6 +5109,25 @@ packages:
...
@@ -4921,6 +5109,25 @@ packages:
typescript
:
5.6.2
typescript
:
5.6.2
dev
:
true
dev
:
true
/ts-checker-rspack-plugin@1.1.0(typescript@5.6.2)
:
resolution
:
{
integrity
:
sha512-nhUzSuSjfgVAJjc+vJa9q8uE7MxAbustG9InRp4ylMfIbkqyJjh7gSuEcL//l76ZSwoKcCod+5lv2mNO0Ugh8g==
}
engines
:
{
node
:
'
>=16.0.0'
}
peerDependencies
:
'
@rspack/core'
:
^1.0.0
typescript
:
'
>=3.8.0'
peerDependenciesMeta
:
'
@rspack/core'
:
optional
:
true
dependencies
:
'
@babel/code-frame'
:
7.26.2
'
@rspack/lite-tapable'
:
1.0.1
chokidar
:
3.6.0
memfs
:
4.15.1
minimatch
:
9.0.5
picocolors
:
1.1.1
typescript
:
5.6.2
dev
:
true
/ts-interface-checker@0.1.13
:
/ts-interface-checker@0.1.13
:
resolution
:
{
integrity
:
sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==
}
resolution
:
{
integrity
:
sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==
}
dev
:
true
dev
:
true
...
...
rsbuild.config.ts
浏览文件 @
f5d9ac8a
...
@@ -2,31 +2,23 @@
...
@@ -2,31 +2,23 @@
* @Author: zengzhe
* @Author: zengzhe
* @Date: 2024-12-27 11:48:34
* @Date: 2024-12-27 11:48:34
* @LastEditors: zengzhe
* @LastEditors: zengzhe
* @LastEditTime: 2024-12-27 1
4:43:43
* @LastEditTime: 2024-12-27 1
7:00:41
* @Description:
* @Description:
*/
*/
import
{
resolve
}
from
'path'
import
{
resolve
}
from
'path'
import
{
defineConfig
,
loadEnv
}
from
'@rsbuild/core'
import
{
defineConfig
,
loadEnv
}
from
'@rsbuild/core'
import
{
createPlugins
}
from
'./build/rsbuild-plugins'
import
{
createPlugins
}
from
'./build/rsbuild-plugins'
import
pkg
from
'./package.json'
import
{
wrapperEnv
}
from
'./build/getEnv'
const
{
dependencies
,
devDependencies
,
name
,
version
}
=
pkg
import
dayjs
from
'dayjs'
const
{
publicVars
}
=
loadEnv
({
prefixes
:
[
'PUBLIC_'
]
})
import
AutoImport
from
'unplugin-auto-import/rspack'
const
Envs
=
wrapperEnv
(
publicVars
)
import
Components
from
'unplugin-vue-components/rspack'
import
{
TDesignResolver
}
from
'unplugin-vue-components/resolvers'
const
{
publicVars
}
=
loadEnv
({
prefixes
:
[
'VITE_'
]
})
const
__APP_INFO__
=
{
pkg
:
{
dependencies
,
devDependencies
,
name
,
version
},
lastBuildTime
:
dayjs
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
importMeta
:
'import.meta'
}
export
default
defineConfig
({
export
default
defineConfig
({
root
:
process
.
cwd
(),
root
:
process
.
cwd
(),
server
:
{
server
:
{
base
:
'/'
,
base
:
Envs
.
PUBLIC_PUBLIC_PATH
,
host
:
'0.0.0.0'
,
port
:
Envs
.
PUBLIC_PORT
,
port
:
3000
,
open
:
Envs
.
PUBLIC_OPEN
,
open
:
true
,
cors
:
true
cors
:
true
},
},
resolve
:
{
resolve
:
{
...
@@ -35,16 +27,10 @@ export default defineConfig({
...
@@ -35,16 +27,10 @@ export default defineConfig({
}
}
},
},
html
:
{
html
:
{
title
:
publicVars
.
VITE_APP_TITLE
,
title
:
''
,
template
:
'./index.html'
template
:
'./index.html'
},
},
source
:
{
source
:
{
define
:
{
__APP_INFO__
:
JSON
.
stringify
(
__APP_INFO__
),
// 启用生产环境构建下激活不匹配的详细警告
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__
:
'false'
,
...
publicVars
},
entry
:
{
entry
:
{
index
:
'./src/main.ts'
index
:
'./src/main.ts'
}
}
...
@@ -55,32 +41,9 @@ export default defineConfig({
...
@@ -55,32 +41,9 @@ export default defineConfig({
},
},
minify
:
true
minify
:
true
},
},
plugins
:
createPlugins
(),
plugins
:
createPlugins
().
plugins
,
tools
:
{
tools
:
createPlugins
().
tools
,
rspack
:
{
performance
:
{
plugins
:
[
removeConsole
:
true
AutoImport
({
imports
:
[
'vue'
,
'vue-router'
],
resolvers
:
[
TDesignResolver
({
library
:
'vue-next'
})
],
dts
:
'src/autoImport.d.ts'
}),
Components
({
// allow auto load markdown components under `./src/components/`
extensions
:
[
'vue'
,
'md'
],
// allow auto import and register components used in markdown
include
:
[
/
\.
vue$/
,
/
\.
vue
\?
vue/
,
/
\.
md$/
],
resolvers
:
[
TDesignResolver
({
library
:
'vue-next'
})
],
dts
:
'src/components.d.ts'
})
]
}
}
}
})
})
src/api/index.ts
浏览文件 @
f5d9ac8a
...
@@ -25,7 +25,7 @@ export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
...
@@ -25,7 +25,7 @@ export interface CustomAxiosRequestConfig extends InternalAxiosRequestConfig {
const
config
=
{
const
config
=
{
// 默认地址请求地址,可在 .env.** 文件中修改
// 默认地址请求地址,可在 .env.** 文件中修改
baseURL
:
import
.
meta
.
env
.
VITE
_API_URL
as
string
,
baseURL
:
import
.
meta
.
env
.
PUBLIC
_API_URL
as
string
,
// 设置超时时间
// 设置超时时间
timeout
:
ResultEnum
.
TIMEOUT
as
number
,
timeout
:
ResultEnum
.
TIMEOUT
as
number
,
paramsSerializer
:
function
(
params
:
any
)
{
paramsSerializer
:
function
(
params
:
any
)
{
...
...
src/components/PwdRisk/index.vue
浏览文件 @
f5d9ac8a
<!--
<!--
* @Author: xiejiang
* @Author: xiejiang
* @Date: 2023-03-08 16:51:55
* @Date: 2023-03-08 16:51:55
* @LastEditors:
xiejiang
* @LastEditors:
zengzhe
* @LastEditTime: 2024-1
1-13 17:09:40
* @LastEditTime: 2024-1
2-27 15:38:09
* @Description: 密码风险等级
* @Description: 密码风险等级
* Copyright(c)2023 by 好老师教育科技有限公司 All right Reserved.
* Copyright(c)2023 by 好老师教育科技有限公司 All right Reserved.
-->
-->
...
...
src/
vite-
env.d.ts
→
src/env.d.ts
浏览文件 @
f5d9ac8a
/// <reference types="vite/client" />
/*
* @Author: zengzhe
* @Date: 2024-12-27 11:15:21
* @LastEditors: zengzhe
* @LastEditTime: 2024-12-27 15:10:51
* @Description:
*/
/// <reference types="@rsbuild/core/types" />
export
interface
ImportMetaEnv
{
export
interface
ImportMetaEnv
{
/** 项目标题 */
/** 项目标题 */
readonly
VITE
_GLOB_APP_TITLE
:
string
readonly
PUBLIC
_GLOB_APP_TITLE
:
string
/** 项目 本地端口 */
/** 项目 本地端口 */
readonly
VITE
_PORT
:
number
readonly
PUBLIC
_PORT
:
number
/** 是否自动打开浏览器 */
/** 是否自动打开浏览器 */
readonly
VITE
_OPEN
:
boolean
readonly
PUBLIC
_OPEN
:
boolean
/** 打包后是否生成包分析文件 */
/** 打包后是否生成包分析文件 */
readonly
VITE
_REPORT
:
boolean
readonly
PUBLIC
_REPORT
:
boolean
/** # 线上环境 */
/** # 线上环境 */
readonly
VITE
_USER_NODE_ENV
:
'development'
|
'production'
|
'test'
readonly
PUBLIC
_USER_NODE_ENV
:
'development'
|
'production'
|
'test'
/** # 公共基础路径 */
/** # 公共基础路径 */
readonly
VITE
_PUBLIC_PATH
:
string
readonly
PUBLIC
_PUBLIC_PATH
:
string
/** # 打包压缩算法 */
/** # 打包压缩算法 */
readonly
VITE
_BUILD_COMPRESS
:
'gzip'
|
'brotli'
|
'gzip,brotli'
|
'none'
readonly
PUBLIC
_BUILD_COMPRESS
:
'gzip'
|
'brotli'
|
'gzip,brotli'
|
'none'
/**打包时是否删除 console */
/**打包时是否删除 console */
readonly
VITE
_DROP_CONSOLE
:
boolean
readonly
PUBLIC
_DROP_CONSOLE
:
boolean
/** # 接口地址 */
/** # 接口地址 */
readonly
VITE
_API_URL
:
string
readonly
PUBLIC
_API_URL
:
string
/** # 接口代理 */
/** # 接口代理 */
readonly
VITE
_PROXY
:
[
string
,
string
][]
readonly
PUBLIC
_PROXY
:
[
string
,
string
][]
}
}
src/routers/index.ts
浏览文件 @
f5d9ac8a
...
@@ -57,7 +57,7 @@ router.beforeEach(async (to, from, next) => {
...
@@ -57,7 +57,7 @@ router.beforeEach(async (to, from, next) => {
NProgress
.
start
()
NProgress
.
start
()
// 2.动态设置标题
// 2.动态设置标题
const
title
=
import
.
meta
.
env
.
VITE
_GLOB_APP_TITLE
const
title
=
import
.
meta
.
env
.
PUBLIC
_GLOB_APP_TITLE
document
.
title
=
to
.
meta
.
title
?
`
${
to
.
meta
.
title
}
-
${
title
}
`
:
title
document
.
title
=
to
.
meta
.
title
?
`
${
to
.
meta
.
title
}
-
${
title
}
`
:
title
// 3.判断是访问登陆页,有 Token 就在当前页面,没有 Token 重置路由到登陆页
// 3.判断是访问登陆页,有 Token 就在当前页面,没有 Token 重置路由到登陆页
...
...
src/typings/global.d.ts
浏览文件 @
f5d9ac8a
...
@@ -65,17 +65,17 @@ declare namespace File {
...
@@ -65,17 +65,17 @@ declare namespace File {
declare
type
Recordable
<
T
=
any
>
=
Record
<
string
,
T
>
declare
type
Recordable
<
T
=
any
>
=
Record
<
string
,
T
>
declare
interface
ViteEnv
{
declare
interface
ViteEnv
{
VITE
_USER_NODE_ENV
:
'development'
|
'production'
|
'test'
PUBLIC
_USER_NODE_ENV
:
'development'
|
'production'
|
'test'
VITE
_GLOB_APP_TITLE
:
string
PUBLIC
_GLOB_APP_TITLE
:
string
VITE
_PORT
:
number
PUBLIC
_PORT
:
number
VITE
_OPEN
:
boolean
PUBLIC
_OPEN
:
boolean
VITE
_REPORT
:
boolean
PUBLIC
_REPORT
:
boolean
VITE
_BUILD_COMPRESS
:
'gzip'
|
'brotli'
|
'gzip,brotli'
|
'none'
PUBLIC
_BUILD_COMPRESS
:
'gzip'
|
'brotli'
|
'gzip,brotli'
|
'none'
VITE
_BUILD_COMPRESS_DELETE_ORIGIN_FILE
:
boolean
PUBLIC
_BUILD_COMPRESS_DELETE_ORIGIN_FILE
:
boolean
VITE
_DROP_CONSOLE
:
boolean
PUBLIC
_DROP_CONSOLE
:
boolean
VITE
_PUBLIC_PATH
:
string
PUBLIC
_PUBLIC_PATH
:
string
VITE
_API_URL
:
string
PUBLIC
_API_URL
:
string
VITE
_PROXY
:
[
string
,
string
][]
PUBLIC
_PROXY
:
[
string
,
string
][]
}
}
interface
ImportMetaEnv
extends
ViteEnv
{
interface
ImportMetaEnv
extends
ViteEnv
{
...
@@ -113,5 +113,3 @@ declare type NullableOrUndefined<T> = T | null | undefined
...
@@ -113,5 +113,3 @@ declare type NullableOrUndefined<T> = T | null | undefined
// 将对象中的属性部分变为可选
// 将对象中的属性部分变为可选
declare
type
Optional
<
T
,
K
extends
keyof
T
>
=
Omit
<
T
,
K
>
&
Partial
<
Pick
<
T
,
K
>>
declare
type
Optional
<
T
,
K
extends
keyof
T
>
=
Omit
<
T
,
K
>
&
Partial
<
Pick
<
T
,
K
>>
src/views/login/index.vue
浏览文件 @
f5d9ac8a
<!--
<!--
* @Author: xiejiang
* @Author: xiejiang
* @Date: 2024-11-05 10:14:56
* @Date: 2024-11-05 10:14:56
* @LastEditors:
xiejiang
* @LastEditors:
zengzhe
* @LastEditTime: 2024-12-
11 22:15:1
5
* @LastEditTime: 2024-12-
30 14:27:2
5
* @Description: 登录
* @Description: 登录
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
* Copyright(c)2024 by 好老师教育科技有限公司 All right Reserved.
-->
-->
...
@@ -70,7 +70,6 @@
...
@@ -70,7 +70,6 @@
</div>
</div>
</div>
</div>
</div>
</div>
<Dialog
<Dialog
:dialog-visible=
"isShowPuzzleVcode"
:dialog-visible=
"isShowPuzzleVcode"
title=
"请拖动滑块完成拼图"
title=
"请拖动滑块完成拼图"
...
@@ -94,7 +93,6 @@ import { HOME_URL } from '@/config'
...
@@ -94,7 +93,6 @@ import { HOME_URL } from '@/config'
// import logo from '@/assets/images/logo.png'
// import logo from '@/assets/images/logo.png'
import
welcome
from
'@/assets/images/welcome.png'
import
welcome
from
'@/assets/images/welcome.png'
import
welcomeInfo
from
'@/assets/images/welcome-info.png'
import
welcomeInfo
from
'@/assets/images/welcome-info.png'
onMounted
(()
=>
{})
onMounted
(()
=>
{})
const
validateTelePhone
:
CustomValidator
=
async
val
=>
{
const
validateTelePhone
:
CustomValidator
=
async
val
=>
{
...
...
tsconfig.json
浏览文件 @
f5d9ac8a
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
"useDefineForClassFields"
:
true
,
"useDefineForClassFields"
:
true
,
"module"
:
"ESNext"
,
"module"
:
"ESNext"
,
"moduleResolution"
:
"Node"
,
"moduleResolution"
:
"Node"
,
"types"
:
[
"vite/client"
],
/*
Strict
Type-Checking
Options
*/
/*
Strict
Type-Checking
Options
*/
"strict"
:
true
/*
Enable
all
strict
type-checking
options.
*/
,
"strict"
:
true
/*
Enable
all
strict
type-checking
options.
*/
,
//
"noImplicitAny"
:
true
,
/*
Raise
error
on
expressions
and
declarations
with
an
implied
'any'
type.
*/
//
"noImplicitAny"
:
true
,
/*
Raise
error
on
expressions
and
declarations
with
an
implied
'any'
type.
*/
...
...
vite.config.ts
deleted
100644 → 0
浏览文件 @
fd0495f5
/*
* @Author: zhanyoulin<zhanyoulin456@163.com>
* @Date: 2023-06-13 09:41:18
* @LastEditors: xiejiang
* @LastEditTime: 2024-12-11 19:24:03
* @Description:
*/
import
{
defineConfig
,
loadEnv
,
ConfigEnv
,
UserConfig
}
from
'vite'
import
dayjs
from
'dayjs'
import
{
resolve
}
from
'path'
import
{
wrapperEnv
}
from
'./build/getEnv'
import
{
createProxy
}
from
'./build/proxy'
import
{
createVitePlugins
}
from
'./build/plugins'
import
pkg
from
'./package.json'
const
{
dependencies
,
devDependencies
,
name
,
version
}
=
pkg
const
__APP_INFO__
=
{
pkg
:
{
dependencies
,
devDependencies
,
name
,
version
},
lastBuildTime
:
dayjs
().
format
(
'YYYY-MM-DD HH:mm:ss'
),
importMeta
:
'import.meta'
}
// @see: https://vitejs.dev/config/
export
default
defineConfig
(({
mode
}:
ConfigEnv
):
UserConfig
=>
{
const
root
=
process
.
cwd
()
const
env
=
loadEnv
(
mode
,
root
)
const
viteEnv
=
wrapperEnv
(
env
)
return
{
base
:
viteEnv
.
VITE_PUBLIC_PATH
,
root
,
resolve
:
{
alias
:
{
'@'
:
resolve
(
__dirname
,
'./src'
)
}
},
define
:
{
__APP_INFO__
:
JSON
.
stringify
(
__APP_INFO__
),
// 启用生产环境构建下激活不匹配的详细警告
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__
:
'false'
},
css
:
{
preprocessorOptions
:
{
scss
:
{
// additionalData: `@use "@/styles/element/index.scss" as *;`
// api: 'modern-compiler'
}
}
},
server
:
{
host
:
'0.0.0.0'
,
port
:
viteEnv
.
VITE_PORT
,
open
:
viteEnv
.
VITE_OPEN
,
cors
:
true
,
// Load proxy configuration from .env.development
proxy
:
createProxy
(
viteEnv
.
VITE_PROXY
)
},
plugins
:
createVitePlugins
(
viteEnv
),
esbuild
:
{
pure
:
viteEnv
.
VITE_DROP_CONSOLE
?
[
'console.log'
,
'debugger'
]
:
[]
},
build
:
{
outDir
:
'dist'
,
minify
:
'esbuild'
,
// esbuild 打包更快,但是不能去除 console.log,terser打包慢,但能去除 console.log
// minify: "terser",
// terserOptions: {
// compress: {
// drop_console: viteEnv.VITE_DROP_CONSOLE,
// drop_debugger: true
// }
// },
// 禁用 gzip 压缩大小报告,可略微减少打包时间
reportCompressedSize
:
false
,
// 规定触发警告的 chunk 大小
chunkSizeWarningLimit
:
2000
,
rollupOptions
:
{
output
:
{
// Static resource classification and packaging
chunkFileNames
:
'assets/js/[name]-[hash].js'
,
entryFileNames
:
'assets/js/[name]-[hash].js'
,
assetFileNames
:
'assets/[ext]/[name]-[hash].[ext]'
}
}
}
}
})
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论