File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- const { execSync } = require ( 'child_process' )
4
- const fs = require ( 'fs' )
5
3
const logger = require ( '@antora/logger' ) ( 'assets-manifest-helper' )
6
4
7
5
module . exports = ( assetPath ) => {
8
- let manifestPath
9
- let manifest
10
- try {
11
- manifestPath = execSync ( 'find ./build/site -name assets-manifest.json' ) . toString ( ) . trim ( )
12
- manifest = JSON . parse ( fs . readFileSync ( manifestPath , 'utf-8' ) )
13
- } catch ( err ) {
14
- logger . error ( err )
6
+ const manifest = global . assetsManifest
7
+ if ( ! manifest ) {
8
+ logger . error (
9
+ `
10
+ Assets manifest not found in global context.
11
+ The .js and .css files from the UI bundle will not be linked properly in the HTML.
12
+ Ensure assets-manifest.json from the UI bundle is parsed and added
13
+ to global.assetsManifest after uiLoader is complete.
14
+ `
15
+ )
16
+ return assetPath
15
17
}
16
- if ( manifest ) return manifest [ assetPath ]
17
- return assetPath
18
+ return manifest [ assetPath ]
18
19
}
You can’t perform that action at this time.
0 commit comments