2025-01-02 03:21:04 +00:00
|
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
import basicSsl from '@vitejs/plugin-basic-ssl'
|
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
2025-01-16 06:58:50 +00:00
|
|
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
2025-01-02 03:21:04 +00:00
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
build: {
|
|
|
|
|
// 开发阶段启用源码映射:https://uniapp.dcloud.net.cn/tutorial/migration-to-vue3.html#需主动开启-sourcemap
|
|
|
|
|
sourcemap: process.env.NODE_ENV === 'development',
|
|
|
|
|
},
|
2025-01-16 06:58:50 +00:00
|
|
|
|
plugins: [
|
|
|
|
|
vue(),
|
|
|
|
|
basicSsl(),
|
|
|
|
|
VitePWA({
|
|
|
|
|
registerType: 'autoUpdate',
|
|
|
|
|
manifest: {
|
|
|
|
|
name: 'P2P Explorer',
|
|
|
|
|
short_name: 'P2P Explorer',
|
|
|
|
|
description: 'P2P文件传输与浏览工具',
|
|
|
|
|
theme_color: '#f5f5f5',//米色
|
|
|
|
|
background_color: '#f5f5f5',
|
|
|
|
|
icons: [
|
|
|
|
|
{
|
|
|
|
|
src: '/static/icon64.png',
|
|
|
|
|
sizes: '64x64',
|
|
|
|
|
type: 'image/png'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
src: '/static/icon256.png',
|
|
|
|
|
sizes: '256x256',
|
|
|
|
|
type: 'image/png'
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
workbox: {
|
|
|
|
|
globPatterns: ['**/*.{js,css,html,ico,png,svg,webp}'],
|
|
|
|
|
runtimeCaching: []
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
],
|
2025-01-02 03:21:04 +00:00
|
|
|
|
server: {
|
|
|
|
|
host: '0.0.0.0',
|
|
|
|
|
},
|
|
|
|
|
})
|