-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
41 lines (39 loc) · 887 Bytes
/
Copy pathvite.config.ts
File metadata and controls
41 lines (39 loc) · 887 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
38
39
40
41
import { createServer, defineConfig } from "vite";
import { VitePluginNode } from "vite-plugin-node";
import { viteStaticCopy } from "vite-plugin-static-copy";
import dotenv from "dotenv";
dotenv.config();
export default defineConfig({
plugins: [
...VitePluginNode({
appPath: "./src/server.ts",
adapter: "fastify"
}),
viteStaticCopy({
targets: [
{
src: "public",
dest: "."
}
]
})
],
esbuild: {
jsxFactory: "elements.createElement",
jsxInject: 'import * as elements from "typed-html/dist/src/elements";'
},
server: {
port: Number(process.env.PORT) || 3000
},
envPrefix: ["VITE_", "DATABASE_", "DB_"],
publicDir: false,
build: {
target: "esnext",
ssrEmitAssets: true,
assetsInlineLimit: 0,
minify: "terser",
rollupOptions: {
treeshake: true
}
}
});