@hyext/builder-revues 1.4.7 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -592,7 +592,7 @@ const PluginDriver = {
|
|
|
592
592
|
class InjectWebviewUrlParamsPlugin {
|
|
593
593
|
apply(pluginDriver) {
|
|
594
594
|
pluginDriver.hooks.onMergedMainPackge.tap('InjectWebviewUrlParamsPlugin', opts => {
|
|
595
|
-
const { compileType, mainPath, extInfo } = opts;
|
|
595
|
+
const { compileType, mainPath, extInfo, builderConfig } = opts;
|
|
596
596
|
const isGame = compileType === COMPILE_TYPE.miniGame;
|
|
597
597
|
if (isGame) {
|
|
598
598
|
const gameJson = fs__default["default"].readJsonSync(path__default["default"].join(mainPath, 'game.json'));
|
|
@@ -601,7 +601,7 @@ class InjectWebviewUrlParamsPlugin {
|
|
|
601
601
|
pluginDriver.context.deviceOrientation = 'landscape';
|
|
602
602
|
}
|
|
603
603
|
}
|
|
604
|
-
const webviewUrlParams =
|
|
604
|
+
const webviewUrlParams = {
|
|
605
605
|
isLandscape: 0,
|
|
606
606
|
disablePopGesture: 1,
|
|
607
607
|
hideStatusBar: isGame ? extInfo.hideNavigationBarTools ? 0 : 1 : 0,
|
|
@@ -612,12 +612,22 @@ class InjectWebviewUrlParamsPlugin {
|
|
|
612
612
|
if (extInfo.forceUsePatchApi) {
|
|
613
613
|
webviewUrlParams.forceUsePatchApi = 1;
|
|
614
614
|
}
|
|
615
|
+
const extraMap = builderConfig.webviewUrlParamsMap;
|
|
616
|
+
pluginDriver.context.webviewUrlParams = webviewUrlParams;
|
|
617
|
+
pluginDriver.context.webviewUrlParamsMap = builderConfig.supportExtTypes.reduce((urlConfig, type) => {
|
|
618
|
+
urlConfig[type] = extraMap && extraMap[type] ? Object.assign({}, webviewUrlParams, extraMap[type]) : webviewUrlParams;
|
|
619
|
+
return urlConfig;
|
|
620
|
+
}, {});
|
|
615
621
|
});
|
|
616
622
|
}
|
|
617
623
|
}
|
|
618
624
|
function makeWebviewUrlParamsStr() {
|
|
619
625
|
const params = PluginDriver.context.webviewUrlParams;
|
|
620
626
|
return params ? objectToParamsStr(params) : '';
|
|
627
|
+
}
|
|
628
|
+
function makeWebviewUrlParamsStrByExtType(extType) {
|
|
629
|
+
const map = PluginDriver.context.webviewUrlParamsMap;
|
|
630
|
+
return map && map[extType] ? objectToParamsStr(map[extType]) : '';
|
|
621
631
|
}
|
|
622
632
|
|
|
623
633
|
const HOST = {
|
|
@@ -728,7 +738,7 @@ function genEntrys(props) {
|
|
|
728
738
|
});
|
|
729
739
|
}
|
|
730
740
|
|
|
731
|
-
const libVersion = "1.4.
|
|
741
|
+
const libVersion = "1.4.2" ;
|
|
732
742
|
const libCdn = '//a.msstatic.com/huya/hd/h5/static-source/revue/lib';
|
|
733
743
|
|
|
734
744
|
function getLibVersion(builderConfig) {
|
|
@@ -797,7 +807,8 @@ function mergeGamePackage(releasePath, opts) {
|
|
|
797
807
|
mainConf: mainPakConf,
|
|
798
808
|
mainPath,
|
|
799
809
|
compileType: COMPILE_TYPE.miniGame,
|
|
800
|
-
extInfo: opts.extInfo
|
|
810
|
+
extInfo: opts.extInfo,
|
|
811
|
+
builderConfig,
|
|
801
812
|
});
|
|
802
813
|
return {
|
|
803
814
|
packagePath,
|
|
@@ -907,7 +918,8 @@ function mergeMiniprogramPackage(releasePath, opts) {
|
|
|
907
918
|
mainConf: mainPakConf,
|
|
908
919
|
mainPath,
|
|
909
920
|
compileType: COMPILE_TYPE.miniProgram,
|
|
910
|
-
extInfo: opts.extInfo
|
|
921
|
+
extInfo: opts.extInfo,
|
|
922
|
+
builderConfig,
|
|
911
923
|
});
|
|
912
924
|
return {
|
|
913
925
|
entrys,
|
|
@@ -1103,14 +1115,13 @@ function makeBuildResults(mode, opts) {
|
|
|
1103
1115
|
const { baseURI, entrys, outputPath } = opts;
|
|
1104
1116
|
const releasePath = path__default["default"].join(outputPath, 'build-result');
|
|
1105
1117
|
const buildResultMap = {};
|
|
1106
|
-
const paramsStr = makeWebviewUrlParamsStr();
|
|
1107
1118
|
const buildResultList = entrys.map(info => {
|
|
1108
1119
|
const result = {
|
|
1109
1120
|
type: 'HTML',
|
|
1110
1121
|
content: {
|
|
1111
1122
|
pages: [
|
|
1112
1123
|
{
|
|
1113
|
-
path: getPagePath(info,
|
|
1124
|
+
path: getPagePath(info, makeWebviewUrlParamsStrByExtType(info.extType))
|
|
1114
1125
|
}
|
|
1115
1126
|
],
|
|
1116
1127
|
baseURI
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyext/builder-revues",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "loler",
|
|
6
6
|
"homepage": "",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@hyext/preload": "^1.1.3",
|
|
28
|
-
"@revues/cocos-web-adapter": "1.
|
|
29
|
-
"@revues/code-compiler": "1.
|
|
30
|
-
"@revues/web-sdk-core": "1.
|
|
28
|
+
"@revues/cocos-web-adapter": "1.5.1",
|
|
29
|
+
"@revues/code-compiler": "1.5.1",
|
|
30
|
+
"@revues/web-sdk-core": "1.5.1",
|
|
31
31
|
"archiver": "^7.0.1",
|
|
32
32
|
"axios": "^1.7.3",
|
|
33
33
|
"chalk": "^2.4.2",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"@types/ramda": "^0.29.11",
|
|
48
48
|
"terser": "^5.31.0"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "4afe6350b1540879e106aaed9eb13e263747109d"
|
|
51
51
|
}
|