-
-
Notifications
You must be signed in to change notification settings - Fork 122
Expand file tree
/
Copy pathvite.config.mjs
More file actions
68 lines (63 loc) · 1.42 KB
/
Copy pathvite.config.mjs
File metadata and controls
68 lines (63 loc) · 1.42 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/**
* SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { resolve } from 'node:path'
import { createAppConfig } from '@nextcloud/vite-config'
import { isBuildWatchArgv } from './src/helpers/isBuildWatchArgv.js'
const isBuildWatch = isBuildWatchArgv()
const buildWatchInclude = [
resolve(import.meta.dirname, 'src/**'),
resolve(import.meta.dirname, 'node_modules/@libresign/pdf-elements/src/**'),
]
export default createAppConfig({
main: resolve('src/main.ts'),
init: resolve('src/init.ts'),
tab: resolve('src/tab.ts'),
settings: resolve('src/settings.ts'),
external: resolve('src/external.ts'),
validation: resolve('src/validation.ts'),
}, {
emptyOutputDirectory: {
additionalDirectories: ['css', 'dist'],
},
config: {
build: {
...(isBuildWatch
? {
watch: {
include: buildWatchInclude,
},
}
: {}),
},
server: {
port: 3000,
host: '0.0.0.0',
},
resolve: {
alias: [
{
find: /^@libresign\/pdf-elements$/,
replacement: resolve(import.meta.dirname, 'node_modules/@libresign/pdf-elements/src/index.ts'),
},
{
find: /^@\//,
replacement: `${resolve(import.meta.dirname, 'src')}/`,
},
],
},
plugins: [
{
name: 'vue-devtools',
config(_, { mode }) {
return {
define: {
__VUE_PROD_DEVTOOLS__: mode !== 'production',
},
}
},
},
],
},
})