-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvite.config.js
52 lines (51 loc) · 1.27 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
43
44
45
46
47
48
49
50
51
52
import { defineConfig } from "vite";
import preact from "@preact/preset-vite";
import { resolve } from "path";
import macrosPlugin from "vite-plugin-babel-macros";
import { nodePolyfills } from "vite-plugin-node-polyfills";
// https://vitejs.dev/config/
export default defineConfig({
base: "",
root: "src",
plugins: [
macrosPlugin(),
preact(),
nodePolyfills({
include: ["path"],
}),
],
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": {},
},
// https://github.com/redhat-developer/yaml-language-server/issues/1014
resolve: {
alias: [
{
find: "vscode-json-languageservice/lib/umd",
replacement: "vscode-json-languageservice/lib/esm",
},
],
},
});