-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.js
36 lines (35 loc) · 937 Bytes
/
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
import { defineConfig } from "vite";
import preact from "@preact/preset-vite";
import { resolve } from "path";
import macrosPlugin from "vite-plugin-babel-macros";
// https://vitejs.dev/config/
export default defineConfig({
base: "",
root: "src",
plugins: [macrosPlugin(), preact()],
build: {
outDir: "../dist",
emptyOutDir: true,
lib: {
entry: [resolve(__dirname, "src/MystEditor.jsx"), resolve(__dirname, "src/index.html"), resolve(__dirname, "src/myst-git/git.html")],
formats: ["es"],
},
rollupOptions: {
output: {
assetFileNames: "MystEditor.css",
manualChunks: (module) => {
if (module.includes("index.html")) {
return "index";
} else if (module.includes("git.html")) {
return "git";
} else {
return "MystEditor";
}
},
},
},
},
define: {
"process.env": {},
},
});