mirror of
https://github.com/nextcloud/server.git
synced 2026-02-24 02:11:51 -05:00
build: fix vite config for assets imported from node modules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
c4eddb5947
commit
55c5b70f10
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