-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathvite.config.js
More file actions
50 lines (49 loc) · 1.4 KB
/
vite.config.js
File metadata and controls
50 lines (49 loc) · 1.4 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
/**
* SPDX-FileCopyrightText: 2024 Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { createAppConfig } from '@nextcloud/vite-config'
import { join, resolve } from 'path'
const customConfig = {
resolve: {
alias: {
'@': resolve('src'),
},
},
css: {
preprocessorOptions: {
scss: {
api: 'modern-compiler',
},
},
},
build: {
// rollup-plugin-esbuild-minify runs in renderChunk (before Rollup resolves
// !~{NNN}~ placeholder hashes) and renames variables to short names that
// collide across chunk sections, causing vite:esbuild-transpile to fail with
// "'_s' is not declared in this file". Use terser instead: it runs in
// generateBundle after all placeholders are resolved.
minify: 'terser',
manifest: 'js/manifest.json',
rollupOptions: {
output: {
// Use content hash instead of version prefix for cache busting
entryFileNames: 'js/[name]-[hash].mjs',
},
},
},
}
export default createAppConfig(
{
main: resolve(join('src', 'main.ts')),
userSettings: resolve(join('src', 'userSettings.ts')),
adminSettings: resolve(join('src', 'adminSettings.ts')),
dashboard: resolve(join('src', 'dashboard.ts')),
reference: resolve(join('src', 'polls-reference.ts')),
},
{
inlineCSS: { relativeCSSInjection: true },
config: customConfig,
minify: false, // disable rollup-plugin-esbuild-minify; terser is used instead (see above)
},
)