-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.renderer.config.ts
47 lines (45 loc) · 1.21 KB
/
vite.renderer.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
import type { ConfigEnv, UserConfig } from 'vite';
import { defineConfig } from 'vite';
import { pluginExposeRenderer } from './vite.base.config';
import monacoEditorPlugin from 'vite-plugin-monaco-editor';
// https://vitejs.dev/config
export default defineConfig((env) => {
const forgeEnv = env as ConfigEnv<'renderer'>;
const { root, mode, forgeConfigSelf } = forgeEnv;
const name = forgeConfigSelf.name ?? '';
return {
root,
mode,
base: './',
define: {
__mode: JSON.stringify(mode),
},
build: {
outDir: `.vite/renderer/${name}`,
rollupOptions: {
input: {
app: "./src/renderer/index.html",
},
}
},
plugins: [
pluginExposeRenderer(name),
monacoEditorPlugin({
publicPath: mode != 'development' ? './' : undefined, // in production we need to adapt this path. Also see renderer.ts.
languageWorkers: ['typescript', 'css', 'html', 'json', 'editorWorkerService'],
}),
],
resolve: {
preserveSymlinks: true,
},
css: {
postcss: {
plugins: [
require('tailwindcss'),
require('autoprefixer'),
],
},
},
clearScreen: false,
} as UserConfig;
});