2022-07-04 22:52:53 +00:00
|
|
|
import { defineConfig } from 'vite'
|
2022-04-18 08:24:47 +00:00
|
|
|
import Vue from '@vitejs/plugin-vue'
|
2022-07-25 18:41:03 +00:00
|
|
|
import Inspector from 'vite-plugin-vue-inspector'
|
2022-04-30 13:25:59 +00:00
|
|
|
import { VitePWA } from 'vite-plugin-pwa'
|
|
|
|
import { resolve } from 'path'
|
2022-02-21 14:07:07 +00:00
|
|
|
|
2022-04-17 22:43:58 +00:00
|
|
|
const port = +(process.env.VUE_PORT ?? 8080)
|
2022-06-23 17:21:06 +00:00
|
|
|
|
2022-02-21 14:07:07 +00:00
|
|
|
// https://vitejs.dev/config/
|
2022-07-31 19:40:31 +00:00
|
|
|
export default defineConfig(({ mode }) => ({
|
2022-08-05 17:14:17 +00:00
|
|
|
envPrefix: ['VUE_', 'FUNKWHALE_SENTRY_'],
|
2022-02-21 22:16:48 +00:00
|
|
|
plugins: [
|
2022-07-31 19:40:31 +00:00
|
|
|
// https://github.com/vitejs/vite/tree/main/packages/plugin-vue
|
|
|
|
Vue(),
|
|
|
|
|
2022-07-25 18:41:03 +00:00
|
|
|
// https://github.com/webfansplz/vite-plugin-vue-inspector
|
|
|
|
Inspector({
|
|
|
|
toggleComboKey: 'alt-shift-d'
|
|
|
|
}),
|
|
|
|
|
2022-04-30 13:25:59 +00:00
|
|
|
// https://github.com/antfu/vite-plugin-pwa
|
|
|
|
VitePWA({
|
|
|
|
strategies: 'injectManifest',
|
|
|
|
srcDir: 'src',
|
|
|
|
filename: 'serviceWorker.ts',
|
2022-07-25 18:41:03 +00:00
|
|
|
manifestFilename: 'manifest.json',
|
2022-04-30 13:25:59 +00:00
|
|
|
devOptions: {
|
|
|
|
enabled: true,
|
|
|
|
type: 'module',
|
2022-07-25 18:41:03 +00:00
|
|
|
navigateFallback: 'index.html'
|
2022-10-13 19:03:06 +00:00
|
|
|
},
|
|
|
|
manifest: {
|
|
|
|
name: 'Funkwhale',
|
2022-10-18 17:37:26 +00:00
|
|
|
categories: ['music', 'entertainment'],
|
2022-10-14 06:36:33 +00:00
|
|
|
start_url: undefined,
|
|
|
|
scope: undefined,
|
2022-10-13 19:03:06 +00:00
|
|
|
short_name: 'Funkwhale',
|
2022-10-17 14:34:48 +00:00
|
|
|
description: 'Your free and federated audio platform',
|
2022-10-13 19:03:06 +00:00
|
|
|
icons: [
|
|
|
|
{
|
|
|
|
src: 'android-chrome-192x192.png',
|
|
|
|
sizes: '192x192',
|
|
|
|
type: 'image/png'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
src: 'android-chrome-512x512.png',
|
|
|
|
sizes: '512x512',
|
|
|
|
type: 'image/png'
|
|
|
|
}
|
2022-10-17 14:35:18 +00:00
|
|
|
],
|
2022-10-18 17:37:26 +00:00
|
|
|
prefer_related_applications: true,
|
2022-10-17 14:35:18 +00:00
|
|
|
related_applications: [
|
|
|
|
{
|
2022-10-18 17:37:26 +00:00
|
|
|
platform: 'play',
|
|
|
|
url: 'https://play.google.com/store/apps/details?id=audio.funkwhale.ffa',
|
|
|
|
id: 'audio.funkwhale.ffa'
|
2022-10-17 14:35:18 +00:00
|
|
|
},
|
|
|
|
{
|
2022-10-18 17:37:26 +00:00
|
|
|
platform: 'f-droid',
|
|
|
|
url: 'https://f-droid.org/en/packages/audio.funkwhale.ffa/',
|
|
|
|
id: 'audio.funkwhale.ffa'
|
|
|
|
}
|
|
|
|
],
|
|
|
|
shortcuts: [
|
|
|
|
{
|
|
|
|
name: 'Search',
|
|
|
|
url: '/search',
|
|
|
|
icons: []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Library',
|
|
|
|
url: '/library',
|
|
|
|
icons: []
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'Channels',
|
|
|
|
url: '/subscriptions',
|
|
|
|
icons: []
|
2022-10-17 14:35:18 +00:00
|
|
|
}
|
2022-10-13 19:03:06 +00:00
|
|
|
]
|
2022-04-30 13:25:59 +00:00
|
|
|
}
|
2022-07-20 18:49:11 +00:00
|
|
|
})
|
2022-06-23 17:21:06 +00:00
|
|
|
],
|
2022-07-21 14:13:42 +00:00
|
|
|
server: {
|
2022-07-21 19:36:08 +00:00
|
|
|
port
|
2022-07-21 14:13:42 +00:00
|
|
|
},
|
2022-02-21 14:07:07 +00:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2022-10-20 14:46:58 +00:00
|
|
|
'#': resolve(__dirname, './src/worker'),
|
2022-09-06 09:18:15 +00:00
|
|
|
'?': resolve(__dirname, './test'),
|
2022-04-30 13:25:59 +00:00
|
|
|
'~': resolve(__dirname, './src')
|
2022-06-23 17:21:06 +00:00
|
|
|
}
|
2022-04-02 17:38:14 +00:00
|
|
|
},
|
2022-08-31 22:36:40 +00:00
|
|
|
test: {
|
|
|
|
environment: 'jsdom',
|
2022-09-15 17:37:44 +00:00
|
|
|
globals: true,
|
|
|
|
coverage: {
|
|
|
|
src: './src',
|
|
|
|
all: true,
|
|
|
|
reporter: ['text', 'cobertura']
|
|
|
|
}
|
2022-06-13 09:53:36 +00:00
|
|
|
}
|
2022-04-17 22:43:58 +00:00
|
|
|
}))
|