funquail/front/vite.config.ts

66 lines
1.6 KiB
TypeScript
Raw Normal View History

2022-07-04 22:52:53 +00:00
import { defineConfig } from 'vite'
2022-07-31 19:40:31 +00:00
import Sentry from 'sentry-vite-plugin'
2022-04-18 10:24:47 +02:00
import Vue from '@vitejs/plugin-vue'
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 15:07:07 +01:00
const port = +(process.env.VUE_PORT ?? 8080)
2022-06-23 17:21:06 +00:00
2022-02-21 15:07:07 +01:00
// https://vitejs.dev/config/
2022-07-31 19:40:31 +00:00
export default defineConfig(({ mode }) => ({
envPrefix: 'VUE_',
plugins: [
2022-07-31 19:40:31 +00:00
// https://github.com/huyanhai/sentry-vite-plugin
Sentry({
url: process.env.VUE_SENTRY_DSN?.split(/(\/|@)/)[6],
include: './dist',
ignore: ['node_modules', 'vite.config.js'],
cleanSourceMap: false,
dryRun: !process.env.VUE_SENTRY_DSN/* || !!process.env.GITPOD_WORKSPACE_ID */,
setCommits: {
auto: true
},
deploy: {
env: mode
2022-04-18 10:24:47 +02:00
}
}),
2022-04-16 13:34:39 +02:00
2022-07-31 19:40:31 +00:00
// https://github.com/vitejs/vite/tree/main/packages/plugin-vue
Vue(),
// 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',
manifestFilename: 'manifest.json',
2022-04-30 13:25:59 +00:00
devOptions: {
enabled: true,
type: 'module',
navigateFallback: 'index.html'
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 15:07:07 +01: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 19:38:14 +02: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
}
}
}
}))