-
-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathelectron.vite.config.mjs
More file actions
43 lines (41 loc) · 956 Bytes
/
Copy pathelectron.vite.config.mjs
File metadata and controls
43 lines (41 loc) · 956 Bytes
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
import react from '@vitejs/plugin-react';
import { defineConfig } from 'electron-vite';
import { dirname, join, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
const rootDir = dirname(fileURLToPath(import.meta.url));
const sassVariablesPath = join(rootDir, 'src/assets/style/Settings/_variables.scss').replace(/\\/g, '/');
const alias = {
'@': resolve(rootDir, 'src'),
};
export default defineConfig({
main: {
build: {
rollupOptions: {
input: {
background: resolve(rootDir, 'src/background.ts'),
},
},
},
},
renderer: {
root: '.',
plugins: [react()],
resolve: {
alias,
},
css: {
preprocessorOptions: {
scss: {
additionalData: `@use "${sassVariablesPath}" as *;`,
},
},
},
build: {
rollupOptions: {
input: {
index: resolve(rootDir, 'index.html'),
},
},
},
},
});