2024-02-06 20:31:38 +03:00
|
|
|
// SPDX-FileCopyrightText: Ferdinand Thiessen <opensource@fthiessen.de>
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2024-10-12 17:25:06 +03:00
|
|
|
/// <reference types="vitest/config" />
|
|
|
|
|
2024-02-06 20:31:38 +03:00
|
|
|
import { createAppConfig } from '@nextcloud/vite-config'
|
2024-08-06 05:29:52 +03:00
|
|
|
import webpackStats from 'rollup-plugin-webpack-stats'
|
2024-02-06 20:31:38 +03:00
|
|
|
import path from 'path'
|
|
|
|
|
|
|
|
const config = createAppConfig({
|
|
|
|
text: path.join(__dirname, 'src', 'main.js'),
|
|
|
|
files: path.join(__dirname, 'src', 'files.js'),
|
|
|
|
public: path.join(__dirname, 'src', 'public.js'),
|
|
|
|
viewer: path.join(__dirname, 'src', 'viewer.js'),
|
|
|
|
editors: path.join(__dirname, 'src', 'editor.js'),
|
|
|
|
init: path.join(__dirname, 'src', 'init.js'),
|
|
|
|
}, {
|
2024-07-11 00:38:38 +03:00
|
|
|
createEmptyCSSEntryPoints: true,
|
2024-02-06 20:31:38 +03:00
|
|
|
config: {
|
2024-07-10 13:48:08 +03:00
|
|
|
resolve: {
|
|
|
|
dedupe: ['vue'],
|
|
|
|
},
|
2024-02-06 20:31:38 +03:00
|
|
|
css: {
|
|
|
|
modules: {
|
|
|
|
localsConvention: 'camelCase',
|
|
|
|
},
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
webpackStats(),
|
|
|
|
],
|
2024-06-11 15:47:36 +03:00
|
|
|
build: {
|
2024-07-11 00:38:38 +03:00
|
|
|
cssCodeSplit: true,
|
2024-06-11 15:47:36 +03:00
|
|
|
rollupOptions: {
|
|
|
|
output: {
|
|
|
|
manualChunks: (id) => {
|
|
|
|
// Make the emoji related dependencies a custom chunk to reduce the size of the RichText chunk
|
|
|
|
if (id.includes('emoji-mart-vue') || id.includes('emoji-datasource')) {
|
|
|
|
return 'emoji-picker'
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-05-13 17:16:00 +03:00
|
|
|
test: {
|
2024-10-13 10:53:48 +03:00
|
|
|
setupFiles: ['src/tests/setup.mjs'],
|
2024-05-13 17:16:00 +03:00
|
|
|
environment: 'jsdom',
|
|
|
|
globals: true,
|
|
|
|
server: {
|
|
|
|
deps: {
|
2024-10-13 10:53:48 +03:00
|
|
|
inline: [/@nextcloud.*/],
|
2024-05-13 17:16:00 +03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2024-02-06 20:31:38 +03:00
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
export default config
|