-
Notifications
You must be signed in to change notification settings - Fork 2
/
vite.config.js
42 lines (37 loc) · 1.16 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
39
40
41
42
import { defineConfig } from 'vite';
import mkcert from 'vite-plugin-mkcert';
import { sveltekit } from '@sveltejs/kit/vite';
// https://github.com/sapphi-red/vite-plugin-static-copy#usage
import { viteStaticCopy } from 'vite-plugin-static-copy'
const files = [];
export default defineConfig(async ({ command }) => {
const { needlePlugins, useGzip, loadConfig } = await import("@needle-tools/engine/plugins/vite/index.js");
const needleConfig = await loadConfig();
return {
plugins: [
mkcert(),
// useGzip(needleConfig) ? viteCompression({ deleteOriginFile: true }) : null,
needlePlugins(command, needleConfig),
viteStaticCopy({
targets: files.map((file) => {
return {
src: file.path,
dest: "downloads",
}
}),
}),
sveltekit(),
],
server: {
port: 3000,
proxy: {},
fs: {
strict: false,
},
},
build: {
emptyOutDir: true,
keepNames: true,
}
}
});