generated from sarioglu/svelte-tailwindcss-template
-
Notifications
You must be signed in to change notification settings - Fork 4
/
renderer.vite.config.mjs
40 lines (39 loc) · 1.17 KB
/
renderer.vite.config.mjs
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
import { svelte } from "@sveltejs/vite-plugin-svelte";
import preprocess from "svelte-preprocess";
import path, { resolve } from "path";
import monacoEditorPlugin from "vite-plugin-monaco-editor";
import copy from "rollup-plugin-copy";
import { preprocessMeltUI, sequence } from "@melt-ui/pp";
export const rendererConfig = ({ outDir = "", additionalPlugins = [] }) => {
return {
plugins: [
svelte({
preprocess: sequence([
preprocess({
postcss: true,
}),
preprocessMeltUI(), // add to the end!
]),
}),
monacoEditorPlugin,
...additionalPlugins,
],
publicDir: "assets", // needed, to copy assets to dist during build
build: {
rollupOptions: {
input: {
index: resolve(__dirname, "src/renderer/index.html"),
},
},
outDir: resolve(__dirname, outDir), // this path is fixed in future electron-vite versions! keep it as is for now at electron-vite v1.0.17!
},
root: resolve(__dirname, "src/renderer"),
resolve: {
alias: {
$lib: path.resolve("src/renderer/lib"),
},
},
target: "chrome104",
envPrefix: "VITE_",
};
};