-
Notifications
You must be signed in to change notification settings - Fork 44
/
vite.config.ts
36 lines (33 loc) · 1008 Bytes
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import { viteSingleFile } from 'vite-plugin-singlefile';
import viteLegacyPlugin from '@vitejs/plugin-legacy';
import { readFileSync } from 'fs';
import { fileURLToPath } from 'url';
const file = fileURLToPath(new URL('package.json', import.meta.url));
const json = readFileSync(file, 'utf8');
const pkg = JSON.parse(json);
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
viteLegacyPlugin({
// targets: ['chrome >= 64', 'edge >= 79', 'safari >= 11.1', 'firefox >= 67'],
// ignoreBrowserslistConfig: true,
renderLegacyChunks: true,
// modernPolyfills: ['es/global-this']
modernPolyfills: true
}),
svelte(),
viteSingleFile()
],
optimizeDeps: { exclude: ['svelte-navigator'] },
define: {
REIVERR_VERSION: `"${pkg.version}"`
}
// base: '/dist',
// experimental: {
// renderBuiltUrl() {
// return { relative: true }
// }
// },
});