-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathvite.config.ts
More file actions
37 lines (34 loc) · 785 Bytes
/
vite.config.ts
File metadata and controls
37 lines (34 loc) · 785 Bytes
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
import { defineConfig, UserConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import path from 'path'
import sveltePreprocess from 'svelte-preprocess'
// https://vitejs.dev/config/
export default defineConfig(({ command }) => {
const config: UserConfig = {
root: 'client',
build: {
outDir: path.join(__dirname, 'dist'),
emptyOutDir: true,
},
resolve: {
alias: {}
},
plugins: [
svelte({
preprocess: sveltePreprocess(),
}),
],
}
if (command !== 'build') {
config.resolve.alias = [
{
find: /^@svelte-use\/(.*)/,
replacement: path.resolve(
__dirname,
'../svelte-use/packages/$1/dist/index.mjs',
),
},
]
}
return config
})