-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.mts
31 lines (28 loc) · 948 Bytes
/
vite.config.mts
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
import { defineConfig, PluginOption } from "npm:vite@4.0.4";
import rakkas from "npm:rakkasjs@0.6.12/vite-plugin";
// deno-lint-ignore no-explicit-any
(globalThis as any).process = { env: Deno.env.toObject() };
const dirname = new URL(".", import.meta.url).pathname;
export default defineConfig({
plugins: [
// Help Vite resolve the client and env entries
{
name: "resolve-vite-client",
enforce: "pre",
resolveId(id) {
if (id.endsWith("node_modules/vite/dist/client/client.mjs")) {
return (
dirname +
"/node_modules/.deno/rakkasjs@0.6.12/node_modules/vite/dist/client/client.mjs"
);
} else if (id.endsWith("node_modules/vite/dist/client/env.mjs")) {
return (
dirname +
"/node_modules/.deno/rakkasjs@0.6.12/node_modules/vite/dist/client/env.mjs"
);
}
},
},
rakkas() as PluginOption,
],
});