-
Notifications
You must be signed in to change notification settings - Fork 11
/
vite.config.ts
54 lines (51 loc) · 1.11 KB
/
vite.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
48
49
50
51
52
53
54
// SPDX-FileCopyrightText: Ferdinand Thiessen <[email protected]>
// SPDX-License-Identifier: AGPL-3.0-or-later
import { createAppConfig } from '@nextcloud/vite-config'
import react from '@vitejs/plugin-react'
import { viteStaticCopy } from 'vite-plugin-static-copy'
import { defineConfig } from 'vite'
import { join, resolve } from 'path'
const AppConfig = createAppConfig({
main: resolve(join('src', 'main.tsx')),
settings: resolve(join('src', 'settings.js')),
}, {
config: defineConfig({
build: {
cssCodeSplit: true,
rollupOptions: {
output: {
manualChunks: {
vendor: ['react', 'react-dom'],
},
},
},
},
css: {
modules: {
localsConvention: 'camelCase',
},
},
optimizeDeps: {
esbuildOptions: {
jsx: 'automatic',
},
},
esbuild: {
jsxInject: 'import React from \'react\'',
},
plugins: [
react({
jsxRuntime: 'classic',
}),
viteStaticCopy({
targets: [
{
src: './node_modules/@excalidraw/excalidraw/dist/excalidraw-assets/*',
dest: './dist/excalidraw-assets',
},
],
}),
],
}),
})
export default AppConfig