-
Notifications
You must be signed in to change notification settings - Fork 54
/
vite.config.ts
35 lines (33 loc) · 1022 Bytes
/
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
/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { createAppConfig } from '@nextcloud/vite-config'
import { readFileSync } from 'node:fs'
import { join } from 'node:path'
const isProduction = process.env.NODE_ENV === 'production'
const plyrIcons = readFileSync(
join(__dirname, 'node_modules', 'plyr', 'dist', 'plyr.svg'),
{ encoding: 'utf8' },
)
export default createAppConfig({
main: 'src/main.js',
init: 'src/init.ts',
}, {
replace: {
PLYR_ICONS: JSON.stringify(plyrIcons),
},
minify: isProduction,
// create REUSE compliant license information for compiled assets
extractLicenseInformation: {
includeSourceMaps: true,
},
// disable BOM because we already have the `.license` files
thirdPartyLicense: false,
// ensure that every JS entry point has a matching CSS file
createEmptyCSSEntryPoints: true,
// Make sure we also clear the CSS directory
emptyOutputDirectory: {
additionalDirectories: ['css'],
},
})