File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import type { UserConfig } from 'vitest/node'
2+
23import { createAppConfig } from '@nextcloud/vite-config'
3- import { join } from 'path'
4+ import { join , relative } from 'path'
45
56// replaced by vite
67declare const __dirname : string
@@ -17,6 +18,31 @@ export default createAppConfig({
1718 // for REUSE we should enable:
1819 // extractLicenseInformation: true,
1920 config : {
21+ experimental : {
22+ renderBuiltUrl ( filename , { hostType } ) {
23+ if ( hostType === 'css' ) {
24+ // CSS `url()` does not support any dynamic path, so we use relative path to the css files
25+ return relative ( '../css' , `../${ filename } ` )
26+ }
27+ return {
28+ runtime : `window.OC.filePath('activity', 'js', '${ filename } ')` ,
29+ }
30+ } ,
31+ } ,
32+ build : {
33+ outDir : 'js' ,
34+ assetsDir : '../' ,
35+ rollupOptions : {
36+ output : {
37+ entryFileNames : ( ) => {
38+ return 'activity-[name].mjs'
39+ } ,
40+ chunkFileNames : ( ) => {
41+ return '[name]-[hash].chunk.mjs'
42+ } ,
43+ } ,
44+ } ,
45+ } ,
2046 // Setup for vitest unit tests
2147 test : {
2248 environment : 'happy-dom' ,
You can’t perform that action at this time.
0 commit comments