1 Star 0 Fork 0

小于的个人工具集/sr-message-maker

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
vite.config.ts 2.37 KB
一键复制 编辑 原始数据 按行查看 历史
blacktunes 提交于 2024-09-24 01:49 +08:00 . build: 优化打包配置
import { fileURLToPath, URL } from 'node:url'
import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx'
import { buildTime } from 'star-rail-vue/vite'
import AutoImport from 'unplugin-auto-import/vite'
import { defineConfig } from 'vite'
import { VitePWA } from 'vite-plugin-pwa'
import VueDevTools from 'vite-plugin-vue-devtools'
// https://vitejs.dev/config/
export default defineConfig({
define: {
DEFAULT_TEXT: JSON.stringify('愿此行,终抵群星'),
DEFAULT_AVATAR: JSON.stringify('星•毁灭')
},
plugins: [
buildTime(),
vue(),
vueJsx(),
AutoImport({
imports: ['vue']
}),
VueDevTools(),
VitePWA({
mode: 'production',
injectRegister: 'auto',
registerType: 'prompt',
manifest: {
id: '/',
name: '崩坏:星穹铁道 - 短信',
short_name: '星铁短信',
description: '崩坏:星穹铁道短信生成器',
display: 'fullscreen',
orientation: 'landscape',
theme_color: '#000',
background_color: '#000',
lang: 'zh-cn',
icons: [
{
src: 'icon.webp',
type: 'image/webp',
sizes: '256x256'
}
],
screenshots: [
{
src: 'preview.webp',
sizes: '1018x500'
},
{
src: 'preview.webp',
sizes: '1018x500',
form_factor: 'wide'
}
]
},
workbox: {
// skipWaiting: true,
disableDevLogs: true,
runtimeCaching: [
{
urlPattern: /(.*?)\.(png|jpe?g|svg|gif|bmp|psd|tiff|tga|eps|ico|webp)/i,
handler: 'CacheFirst',
options: {
cacheName: 'image-cache'
}
},
{
urlPattern: /(.*?)\.(woff2)/i,
handler: 'CacheFirst',
options: {
cacheName: 'font-cache'
}
}
]
},
devOptions: {
enabled: true,
suppressWarnings: true
}
})
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
},
build: {
rollupOptions: {
output: {
manualChunks: {
vue: ['vue'],
sr: ['star-rail-vue']
}
}
},
assetsInlineLimit: 1024 * 200,
chunkSizeWarningLimit: 1024
}
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xgotool/sr-message-maker.git
git@gitee.com:xgotool/sr-message-maker.git
xgotool
sr-message-maker
sr-message-maker
master

搜索帮助