mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
Merge pull request #58505 from nextcloud/build/vite-config
build: fix vite config for assets imported from node modules
This commit is contained in:
commit
fabf017fd6
1 changed files with 6 additions and 3 deletions
|
|
@ -100,11 +100,14 @@ export default createAppConfig(Object.fromEntries(viteModuleEntries), {
|
|||
output: {
|
||||
entryFileNames: '[name].mjs',
|
||||
chunkFileNames: '[name]-[hash].chunk.mjs',
|
||||
assetFileNames({ originalFileNames }) {
|
||||
assetFileNames(ctx) {
|
||||
const { originalFileNames } = ctx
|
||||
const [name] = originalFileNames
|
||||
if (name) {
|
||||
const [, appId] = name.match(/apps\/([^/]+)\//)!
|
||||
return `${appId}-[name]-[hash][extname]`
|
||||
const [, appId] = name.match(/apps\/([^/]+)\//) ?? []
|
||||
if (appId) {
|
||||
return `${appId}-[name]-[hash][extname]`
|
||||
}
|
||||
}
|
||||
return '[name]-[hash][extname]'
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue