-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
vite.config.js
33 lines (32 loc) · 1.03 KB
/
vite.config.js
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
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vitest/config';
import { exampleImportPlugin } from './scripts/vite/example-import.js';
import {
minifiedSizeAnalyzingPlugin,
manualChunksForAnalyzing
} from './scripts/vite/minified-size-analyzing.js';
/** @type {import('vite').UserConfig} */
export default defineConfig({
plugins: [sveltekit(), exampleImportPlugin(), minifiedSizeAnalyzingPlugin()],
optimizeDeps: {
include: ['highlight.js', 'highlight.js/lib/core']
},
build: {
minify: 'esbuild', // We specify this explicitly, since we need the server code to be minified for size computation.
rollupOptions: {
output: {
manualChunks: manualChunksForAnalyzing
}
}
},
ssr: {
noExternal: [
// So that 'esm-env-robust' dependency will be embedded,
// and (a huge!!) minification could be performed by knowing if we're running on the server or on the client.
'esm-env-robust'
]
},
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
}
});