dfklfg/packages/app/vite.config.ts

38 lines
852 B
TypeScript
Raw Normal View History

2023-11-17 11:52:10 +00:00
import react from '@vitejs/plugin-react';
2023-11-20 12:22:52 +00:00
import { VitePWA } from 'vite-plugin-pwa';
2023-11-20 14:19:15 +00:00
import { visualizer } from 'rollup-plugin-visualizer';
import { defineConfig, type PluginOption } from 'vite';
2023-11-17 11:52:10 +00:00
import appConfig from "config";
export default defineConfig({
2023-11-20 12:22:52 +00:00
plugins: [
react(),
VitePWA({
strategies: 'injectManifest',
srcDir: 'src',
filename: 'service-worker.ts',
devOptions: {
enabled: true,
type: 'module',
}
2023-11-20 14:19:15 +00:00
}),
visualizer({
open: true,
gzipSize: true,
filename: 'dist/stats.html',
} as PluginOption),
2023-11-20 12:22:52 +00:00
],
2023-11-17 11:52:10 +00:00
assetsInclude: ['**/*.md'],
resolve: {
alias: {
'@': '/src',
},
},
define: {
CONFIG: JSON.stringify(appConfig),
global: {}, // needed for custom-event lib
SINGLE_RELAY: JSON.stringify(process.env.SINGLE_RELAY),
},
});