first commit
This commit is contained in:
50
vite.config.ts
Normal file
50
vite.config.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import path from 'node:path'
|
||||
import { defineConfig } from 'vite'
|
||||
import tailwindcss from '@tailwindcss/vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import { VitePWA } from 'vite-plugin-pwa'
|
||||
|
||||
export default defineConfig({
|
||||
base: './',
|
||||
root: path.resolve(__dirname, 'apps/demo'),
|
||||
publicDir: path.resolve(__dirname, 'public'),
|
||||
plugins: [
|
||||
vue(),
|
||||
tailwindcss(),
|
||||
VitePWA({
|
||||
registerType: 'prompt',
|
||||
includeAssets: ['favicon.svg', 'app-icon.svg'],
|
||||
manifest: {
|
||||
name: 'Native Vue Messenger',
|
||||
short_name: 'NVR Messenger',
|
||||
description: 'Gesture-first navigation for Vue applications',
|
||||
theme_color: '#0b0d12',
|
||||
background_color: '#0b0d12',
|
||||
display: 'standalone',
|
||||
orientation: 'any',
|
||||
start_url: '/',
|
||||
icons: [
|
||||
{ src: '/app-icon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'any' },
|
||||
{ src: '/app-icon.svg', sizes: 'any', type: 'image/svg+xml', purpose: 'maskable' },
|
||||
],
|
||||
},
|
||||
workbox: {
|
||||
navigateFallback: '/index.html',
|
||||
globPatterns: ['**/*.{js,css,html,svg,png,woff2}'],
|
||||
},
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: [
|
||||
{ find: /^@\/(.*)$/, replacement: `${path.resolve(__dirname, 'apps/demo/src')}/$1` },
|
||||
{ find: /^@native-vue-router\/core$/, replacement: path.resolve(__dirname, 'packages/core/src/index.ts') },
|
||||
{ find: /^@native-vue-router\/preset-native$/, replacement: path.resolve(__dirname, 'packages/preset-native/src/index.ts') },
|
||||
{ find: /^@native-vue-router\/capacitor$/, replacement: path.resolve(__dirname, 'packages/capacitor/src/index.ts') },
|
||||
{ find: /^@native-vue-router\/electron$/, replacement: path.resolve(__dirname, 'packages/electron/src/index.ts') },
|
||||
],
|
||||
},
|
||||
build: {
|
||||
outDir: path.resolve(__dirname, 'apps/demo/dist'),
|
||||
emptyOutDir: true,
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user