@@ -44,6 +44,7 @@ module.exports = class {
44
44
} , ( { compilation, callback, assets } ) => {
45
45
const assetNames = Object . keys ( assets ) ;
46
46
const appConfig = getValue ( 'staticConfig' ) ;
47
+
47
48
const { scripts, metas, links } = applyMethod ( 'rax.getInjectedHTML' ) ;
48
49
let manifestJSON = transformAppConfig ( appConfig ) ;
49
50
const devUrls = [ ] ;
@@ -72,8 +73,14 @@ module.exports = class {
72
73
manifestJSON . scripts ,
73
74
) || [ ] ;
74
75
75
- // if has tabBar, do not generate multiple manifest.json
76
76
if ( manifestJSON . tab_bar ) {
77
+ // Try save html string of custom tabbar to html of tab_bar.
78
+ const { document } = applyMethod ( 'rax.getDocument' , { name : 'customtabbar' } ) || { } ;
79
+ if ( document && ! manifestJSON . html ) {
80
+ manifestJSON . tab_bar . html = document ;
81
+ }
82
+
83
+ // If has tabBar, do not generate multiple manifest.json
77
84
manifestJSON = setRealUrlToManifest (
78
85
{
79
86
urlPrefix : pagePrefix ,
@@ -104,14 +111,15 @@ module.exports = class {
104
111
} )
105
112
. forEach ( ( { source, entryName, __frameIndex } ) => {
106
113
let copyManifestJSON = cloneDeep ( manifestJSON ) ;
107
- copyManifestJSON . pages = copyManifestJSON . pages . filter ( ( page ) => {
108
- // has frames
109
- if ( __frameIndex === 0 ) {
110
- return ! ! ( page . frames && page . frames [ 0 ] && page . frames [ 0 ] . source === source ) ;
111
- } else {
112
- return page . source === source ;
114
+
115
+ // Move current page to pages[0].
116
+ for ( let i = 0 ; i < copyManifestJSON . pages . length ; i ++ ) {
117
+ const page = copyManifestJSON . pages [ i ] ;
118
+ if ( page . source === source || ( __frameIndex === 0 && ( page . frames && page . frames [ 0 ] && page . frames [ 0 ] . source === source ) ) ) {
119
+ copyManifestJSON . pages . unshift ( copyManifestJSON . pages . splice ( i , 1 ) [ 0 ] ) ;
120
+ break ;
113
121
}
114
- } ) ;
122
+ }
115
123
116
124
const { pages } = copyManifestJSON ;
117
125
// take out the page data prefetch and assign it to the root node
0 commit comments