This commit is contained in:
+1
-1
@@ -1,2 +1,2 @@
|
||||
VITE_API_URL=https://hereconnect.condev.ru/api
|
||||
VITE_READ_BASE_URL=https://r.condev.ru
|
||||
VITE_READ_BASE_URL=https://r.condev.ru
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
VITE_MANIFEST_NAME=НаСвязи-dev
|
||||
VITE_MANIFEST_SHORT_NAME=НаСвязи-dev
|
||||
Vendored
-1
@@ -30,7 +30,6 @@ declare module 'vue' {
|
||||
ProgressSpinner: typeof import('primevue/progressspinner')['default']
|
||||
QRCodeCard: typeof import('./src/components/manage/QRCodeCard.vue')['default']
|
||||
QueryRender: typeof import('./src/components/QueryRender.vue')['default']
|
||||
RadioButton: typeof import('primevue/radiobutton')['default']
|
||||
ReadContactInfo: typeof import('./src/components/read/ReadContactInfo.vue')['default']
|
||||
ReadMessageSender: typeof import('./src/components/read/ReadMessageSender.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
|
||||
@@ -63,11 +63,14 @@
|
||||
"npm-run-all2": "^7.0.1",
|
||||
"postcss": "^8.4.49",
|
||||
"prettier": "^3.3.3",
|
||||
"rollup-plugin-manifest-json": "^1.7.0",
|
||||
"tailwindcss": "^3.4.14",
|
||||
"typescript": "~5.6.3",
|
||||
"unplugin-auto-import": "^0.18.6",
|
||||
"unplugin-info": "^1.2.1",
|
||||
"unplugin-vue-components": "^0.27.4",
|
||||
"vite": "^5.4.10",
|
||||
"vite-plugin-mock-data": "^4.0.6",
|
||||
"vite-plugin-vue-devtools": "^7.5.4",
|
||||
"vitest": "^2.1.4",
|
||||
"vue-tsc": "^2.1.10"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, defineProps } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import type { QRCodeDocument } from '@hereconnect/types'
|
||||
|
||||
const props = defineProps<{
|
||||
|
||||
@@ -1,10 +1,17 @@
|
||||
{
|
||||
"name": "НаСвязи",
|
||||
"short_name": "НаСвязи",
|
||||
"categories": ["communication", "utilities", "social", "productivity"],
|
||||
"id": "https://hereconnect.condev.ru",
|
||||
"start_url": "https://hereconnect.condev.ru/manage/dashboard",
|
||||
"scope": "https://hereconnect.condev.ru/",
|
||||
"id": "hereconnect",
|
||||
"start_url": "/manage/dashboard",
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone",
|
||||
"gcm_sender_id": "822536580006",
|
||||
"categories": [
|
||||
"communication",
|
||||
"utilities",
|
||||
"social",
|
||||
"productivity"
|
||||
],
|
||||
"icons": [
|
||||
{
|
||||
"src": "/android-chrome-192x192.png",
|
||||
@@ -16,9 +23,5 @@
|
||||
"sizes": "512x512",
|
||||
"type": "image/png"
|
||||
}
|
||||
],
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#ffffff",
|
||||
"display": "standalone",
|
||||
"gcm_sender_id": "822536580006"
|
||||
]
|
||||
}
|
||||
@@ -2,7 +2,11 @@
|
||||
"extends": "@vue/tsconfig/tsconfig.dom.json",
|
||||
"include": ["./components.d.ts", "env.d.ts", "src/**/*", "src/**/*.vue"],
|
||||
"exclude": ["src/**/__tests__/*"],
|
||||
"files": ["./components.d.ts", "./auto-imports.d.ts"],
|
||||
"files": [
|
||||
"./components.d.ts",
|
||||
"./auto-imports.d.ts",
|
||||
"unplugin-info/client"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"composite": true,
|
||||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
|
||||
@@ -1,16 +1,33 @@
|
||||
import { fileURLToPath, URL } from 'node:url'
|
||||
|
||||
import { defineConfig } from 'vite'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import vueDevTools from 'vite-plugin-vue-devtools'
|
||||
import Components from 'unplugin-vue-components/vite'
|
||||
import { PrimeVueResolver } from '@primevue/auto-import-resolver'
|
||||
import Info from 'unplugin-info/vite'
|
||||
import AutoImport from 'unplugin-auto-import/vite'
|
||||
import { unheadComposablesImports } from 'unhead'
|
||||
import mockData, { type RouteConfig } from 'vite-plugin-mock-data'
|
||||
import manifestJSON from 'rollup-plugin-manifest-json'
|
||||
import { type ManifestOptions } from 'rollup-plugin-manifest-json/lib/types'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig(({ mode }) => {
|
||||
console.log('Building in mode', mode)
|
||||
|
||||
process.env = { ...loadEnv(mode, process.cwd()), ...process.env }
|
||||
|
||||
const manifest: ManifestOptions & { id?: string } = Object.fromEntries(
|
||||
Object.entries({
|
||||
name: process.env.VITE_MANIFEST_NAME,
|
||||
short_name: process.env.VITE_MANIFEST_SHORT_NAME,
|
||||
id: process.env.VITE_MANIFEST_ID,
|
||||
start_url: process.env.VITE_MANIFEST_START_URL,
|
||||
scope: process.env.VITE_MANIFEST_SCOPE,
|
||||
}).filter((entry) => entry[1] !== undefined),
|
||||
)
|
||||
|
||||
return {
|
||||
build: {
|
||||
sourcemap: mode === 'development',
|
||||
@@ -92,13 +109,40 @@ export default defineConfig(({ mode }) => {
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
|
||||
Info(),
|
||||
|
||||
AutoImport({
|
||||
imports: ['vue', 'vue-router', unheadComposablesImports[0]],
|
||||
}),
|
||||
|
||||
Components({
|
||||
resolvers: [PrimeVueResolver()],
|
||||
}),
|
||||
|
||||
vueDevTools(),
|
||||
|
||||
mockData({
|
||||
mockRoutes: {
|
||||
'/manifest.json': {
|
||||
async handler(req, res) {
|
||||
const { default: manifestJSON } = await import('./src/manifest.json')
|
||||
res.statusCode = 200
|
||||
res.setHeader('Content-Type', 'text/html')
|
||||
res.end(JSON.stringify({ ...manifestJSON, ...manifest }, null, 2))
|
||||
},
|
||||
} satisfies RouteConfig,
|
||||
},
|
||||
}),
|
||||
{
|
||||
...manifestJSON({
|
||||
input: 'src/manifest.json', // Required
|
||||
output: './manifest.json',
|
||||
minify: mode === 'production',
|
||||
manifest,
|
||||
}),
|
||||
apply: 'build',
|
||||
},
|
||||
],
|
||||
define: {
|
||||
global: 'window', // it is needed for PouchDB
|
||||
|
||||
Reference in New Issue
Block a user