forked from orefalo/svelte-splitpanes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.js
38 lines (33 loc) · 1.04 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
34
35
36
37
38
import path from 'path';
import { sveltekit } from '@sveltejs/kit/vite';
import { exampleImportPlugin } from './scripts/vite/example-import.js';
import { minifiedSizeAnalyzingPlugin, manualChunksForAnalyzing } from './scripts/vite/minified-size-analyzing.js';
/** @type {import('vite').UserConfig} */
const config = {
plugins: [sveltekit(), exampleImportPlugin(), minifiedSizeAnalyzingPlugin()],
resolve: {
optimizeDeps: {
include: ['highlight.js', 'highlight.js/lib/core']
},
alias: {
'svelte-splitpanes': path.resolve('.', 'src/lib'),
$comp: path.resolve('./src/comp')
}
},
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'
]
}
};
export default config;