forked from solidjs-community/solid-three
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
60 lines (60 loc) · 1.64 KB
/
vite.config.ts
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { defineConfig } from "vite";
import solidPlugin from "vite-plugin-solid";
import inspect from "vite-plugin-inspect";
import { DOMElements, SVGElements } from "solid-js/web/dist/dev.cjs";
export default defineConfig(async (mode) => ({
build:
process.env.BUILD_MODE === "lib"
? {
lib: {
entry: "./src/index.tsx",
formats: ["es", "cjs", "umd"],
fileName: "index",
name: "SolidThree",
},
minify: false,
rollupOptions: {
external: [
"solid-js",
"solid-js/web",
"solid-js/store",
"three",
"zustand",
"zustand/vanilla",
],
},
polyfillDynamicImport: false,
}
: {},
plugins: [
// mdx({
// transformMDX: (code) => {
// return code.replace(/<\!--[a-zA-Z\.\s]+-->/g, ` `);
// },
// xdm: {
// remarkPlugins: [(await import("remark-gfm")).default],
// },
// }),
// for the playground, we need to be able to use the renderer from the src itself
solidPlugin({
solid: {
moduleName: "solid-js/web",
// @ts-ignore
generate: "dynamic",
renderers: [
{
name: "dom",
moduleName: "solid-js/web",
elements: [...DOMElements.values(), ...SVGElements.values()],
},
{
name: "universal",
moduleName: "/src/renderer.tsx",
elements: [],
},
],
},
}),
inspect(),
],
}));