mirror of
https://github.com/nextcloud/server.git
synced 2026-02-27 18:37:17 +01:00
build: fix vite config for assets imported from node modules
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
@@ -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]'
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user