first commit
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
|
||||
export default defineConfig({
|
||||
base: './',
|
||||
build: {
|
||||
target: 'es2020',
|
||||
chunkSizeWarningLimit: 4000
|
||||
},
|
||||
optimizeDeps: {
|
||||
exclude: ['mupdf']
|
||||
},
|
||||
plugins: [
|
||||
VitePWA({
|
||||
registerType: 'autoUpdate',
|
||||
injectRegister: false,
|
||||
includeAssets: ['icons/favicon.svg', 'icons/apple-touch-icon.png'],
|
||||
manifest: {
|
||||
name: '万能看图 · DWG/PDF 浏览',
|
||||
short_name: '涓囪兘鐪嬪浘',
|
||||
description:
|
||||
'手机与平板上的 DWG 图纸浏览器,支持模型空间与布局空间、图层控制、测量,以及 PDF / EPUB / XPS / CBZ / 图片阅读。',
|
||||
lang: 'zh-CN',
|
||||
dir: 'ltr',
|
||||
start_url: './',
|
||||
scope: './',
|
||||
display: 'standalone',
|
||||
display_override: ['window-controls-overlay', 'standalone', 'minimal-ui'],
|
||||
orientation: 'any',
|
||||
background_color: '#0b0e14',
|
||||
theme_color: '#0b0e14',
|
||||
categories: ['productivity', 'utilities', 'graphics'],
|
||||
icons: [
|
||||
{ src: 'icons/icon-192.png', sizes: '192x192', type: 'image/png', purpose: 'any' },
|
||||
{ src: 'icons/icon-512.png', sizes: '512x512', type: 'image/png', purpose: 'any' },
|
||||
{ src: 'icons/icon-maskable-512.png', sizes: '512x512', type: 'image/png', purpose: 'maskable' }
|
||||
],
|
||||
file_handlers: [
|
||||
{
|
||||
action: './',
|
||||
accept: {
|
||||
'application/pdf': ['.pdf'],
|
||||
'image/vnd.dwg': ['.dwg'],
|
||||
'application/acad': ['.dwg'],
|
||||
'application/epub+zip': ['.epub'],
|
||||
'application/vnd.ms-xpsdocument': ['.xps'],
|
||||
'application/oxps': ['.oxps'],
|
||||
'application/vnd.comicbook+zip': ['.cbz'],
|
||||
'image/png': ['.png'],
|
||||
'image/jpeg': ['.jpg', '.jpeg'],
|
||||
'image/gif': ['.gif'],
|
||||
'image/bmp': ['.bmp']
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
workbox: {
|
||||
globPatterns: ['**/*.{js,css,html,svg,png,ico,woff2}'],
|
||||
globIgnores: ['**/vendor/**', '**/samples/**'],
|
||||
maximumFileSizeToCacheInBytes: 4 * 1024 * 1024,
|
||||
navigateFallback: 'index.html',
|
||||
cleanupOutdatedCaches: true,
|
||||
runtimeCaching: [
|
||||
{
|
||||
urlPattern: /\/vendor\/(?:libredwg|mupdf)\//,
|
||||
handler: 'CacheFirst',
|
||||
options: {
|
||||
cacheName: 'viewer-engines-v1',
|
||||
expiration: { maxEntries: 12, maxAgeSeconds: 60 * 60 * 24 * 365 }
|
||||
}
|
||||
},
|
||||
{
|
||||
urlPattern: /\/samples\//,
|
||||
handler: 'CacheFirst',
|
||||
options: {
|
||||
cacheName: 'viewer-samples-v1',
|
||||
expiration: { maxEntries: 12, maxAgeSeconds: 60 * 60 * 24 * 365 }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
]
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user