funkwhale/front/vite.config.ts

55 wiersze
1.1 KiB
TypeScript
Czysty Zwykły widok Historia

2022-07-21 19:36:08 +00:00
// import type { HmrOptions } from 'vite'
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-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
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/
export default defineConfig(() => ({
envPrefix: 'VUE_',
plugins: [
2022-04-16 11:34:39 +00:00
// https://github.com/underfin/vite-plugin-vue2
2022-04-18 08:24:47 +00:00
Vue({
template: {
compilerOptions: {
compatConfig: {
MODE: 2
}
}
}
}),
2022-04-16 11:34:39 +00:00
2022-04-30 13:25:59 +00:00
// https://github.com/antfu/vite-plugin-pwa
VitePWA({
strategies: 'injectManifest',
srcDir: 'src',
filename: 'serviceWorker.ts',
devOptions: {
enabled: true,
type: 'module',
2022-07-20 14:43:32 +00:00
navigateFallback: 'index.html',
webManifestUrl: '/front/manifest.json'
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-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-06-13 09:53:36 +00:00
build: {
rollupOptions: {
input: {
2022-06-26 07:27:16 +00:00
main: resolve(__dirname, './index.html'),
embed: resolve(__dirname, './embed.html')
2022-06-13 09:53:36 +00:00
}
}
}
}))