Skip to content
Snippets Groups Projects
Commit a25c2e13 authored by julian.baeume's avatar julian.baeume :pick: Committed by julian.baeume
Browse files

inject dependencies into manifest.json data

this got lost when implementation changed to base data on vite manifests but should
still be part of the manifest.json file
parent d1e56b11
No related branches found
No related tags found
No related merge requests found
......@@ -107,5 +107,10 @@ describe('Vite manifest parsing', () => {
'settings',
'io.ox/core/main'
])
expect(manifests.map(manifest => manifest.dependencies)).toEqual([
['io.ox/guidedtours/preload-helper-a7bbbf37.js'],
['io.ox/guidedtours/preload-helper-a7bbbf37.js', 'io.ox/guidedtours/i18n.3de05d46.js'],
['io.ox/guidedtours/preload-helper-a7bbbf37.js', 'io.ox/guidedtours/i18n.3de05d46.js']
])
})
})
......@@ -41,14 +41,18 @@ export const loadViteManifests = (() => {
})()
export function viteToOxManifest (viteManifests) {
const deps = viteManifestToDeps(viteManifests)
return Object.values(viteManifests)
.filter(manifest => Array.isArray(manifest?.meta?.manifests))
.map(manifest =>
manifest.meta.manifests.map(oxManifest => {
return {
const dependencies = deps[manifest.file]
const data = {
...oxManifest,
path: manifest.file.slice(0, -path.parse(manifest.file).ext.length)
}
if (dependencies?.length > 0) data.dependencies = dependencies
return data
})
)
.flat()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment