Skip to content

Commit

Permalink
fix(loader): 修复百度小程序渲染问题,#7293
Browse files Browse the repository at this point in the history
  • Loading branch information
Chen-jj committed Feb 9, 2021
1 parent 7623ba9 commit ff4a10d
Show file tree
Hide file tree
Showing 25 changed files with 189 additions and 41 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"@types/jest": "^26.0.14",
"@types/lodash": "^4.14.142",
"@types/node": "^12.7.11",
"@types/react": "^16.9.5",
"@types/react": "16.9.49",
"@types/sinon": "^7.5.0",
"@types/tapable": "1.0.5",
"@types/webpack": "^4.39.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/taro-cli/src/doctor/configSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const schema = Joi.object().keys({
Joi.object().keys({
from: Joi.string().required(),
to: Joi.string().required(),
ignore: Joi.string()
ignore: Joi.array().items(Joi.string())
})
),

Expand Down
2 changes: 1 addition & 1 deletion packages/taro-loader/src/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import component from ${stringify(componentPath)}
var config = ${configString};
${config.enableShareTimeline ? 'component.enableShareTimeline = true' : ''}
${config.enableShareAppMessage ? 'component.enableShareAppMessage = true' : ''}
var inst = Page(createPageConfig(component, '${options.name}', {}, config || {}))
var inst = Page(createPageConfig(component, '${options.name}', {root:{cn:[]}}, config || {}))
${options.prerender ? prerender : ''}
`
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
} ], [ [ 18, 0, 1, 3, 2 ] ] ]);
/** filePath: dist/pages/index/index.json **/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
}
}, [ [ 15, 0, 1, 3, 2 ] ] ]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
} ], [ [ 18, 0, 1, 3, 2 ] ] ]);
/** filePath: dist/pages/index/index.json **/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u5173\\\\u4e8e\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(about_Index, \\"pages/about/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(about_Index, \\"pages/about/index\\", {
root: {
cn: []
}
}, config || {}));
}
}, [ [ 18, 0, 1, 3, 2 ] ] ]);
Expand Down Expand Up @@ -944,7 +948,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
}
}, [ [ 17, 0, 1, 3, 2 ] ] ]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
}
}, [ [ 14, 0, 1, 3, 2 ] ] ]);
Expand Down Expand Up @@ -2146,7 +2150,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
}
}, [ [ 14, 0, 1, 3, 2 ] ] ]);
Expand Down Expand Up @@ -3282,7 +3290,11 @@ I m irrelevant.
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
}
}, [ [ 14, 0, 1, 3, 2 ] ] ]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
},
7: function(module, exports, __webpack_require__) {
module.exports = {
Expand Down Expand Up @@ -2031,7 +2035,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
},
7: function(module, exports, __webpack_require__) {
module.exports = {
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2325,7 +2325,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
} ], [ [ 19, 0, 1, 3, 2 ] ] ]);
/** filePath: dist/pages/index/index.json **/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
}
}, [ [ 14, 0, 1, 3, 2 ] ] ]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -864,7 +864,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
}
}, [ [ 15, 0, 1, 3, 2 ] ] ]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,11 @@ require(\\"./taro\\");
var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
var _node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(19);
var config = {};
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"others/detail/index\\", {}, config || {}));
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"others/detail/index\\", {
root: {
cn: []
}
}, config || {}));
if (typeof PRERENDER !== \\"undefined\\") {
global._prerender = inst;
}
Expand Down Expand Up @@ -2192,7 +2196,11 @@ require(\\"./taro\\");
var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
var _node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(20);
var config = {};
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"others/normal/index\\", {}, config || {}));
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"others/normal/index\\", {
root: {
cn: []
}
}, config || {}));
}
}, [ [ 31, 0, 1, 3, 2 ] ] ]);

Expand Down Expand Up @@ -2245,7 +2253,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
if (typeof PRERENDER !== \\"undefined\\") {
global._prerender = inst;
}
Expand Down Expand Up @@ -4769,7 +4781,11 @@ require(\\"./taro\\");
var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
var _node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13);
var config = {};
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"others/detail/index\\", {}, config || {}));
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"others/detail/index\\", {
root: {
cn: []
}
}, config || {}));
if (typeof PRERENDER !== \\"undefined\\") {
global._prerender = inst;
}
Expand Down Expand Up @@ -4830,7 +4846,11 @@ require(\\"./taro\\");
return Index;
}(react[\\"Component\\"]);
var config = {};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(normal_Index, \\"others/normal/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(normal_Index, \\"others/normal/index\\", {
root: {
cn: []
}
}, config || {}));
}
}, [ [ 24, 0, 1, 3, 2 ] ] ]);

Expand Down Expand Up @@ -4883,7 +4903,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
if (typeof PRERENDER !== \\"undefined\\") {
global._prerender = inst;
}
Expand Down Expand Up @@ -7377,7 +7401,11 @@ require(\\"./taro\\");
var _tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
var _node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13);
var config = {};
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"others/detail/index\\", {}, config || {}));
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"others/detail/index\\", {
root: {
cn: []
}
}, config || {}));
if (typeof PRERENDER !== \\"undefined\\") {
global._prerender = inst;
}
Expand Down Expand Up @@ -7438,7 +7466,11 @@ require(\\"./taro\\");
return Index;
}(react[\\"Component\\"]);
var config = {};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(normal_Index, \\"others/normal/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(normal_Index, \\"others/normal/index\\", {
root: {
cn: []
}
}, config || {}));
}
}, [ [ 24, 0, 1, 3, 2 ] ] ]);

Expand Down Expand Up @@ -7491,7 +7523,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(_tarojs_runtime__WEBPACK_IMPORTED_MODULE_0__[\\"createPageConfig\\"])(_node_modules_babel_loader_lib_index_js_index_jsx__WEBPACK_IMPORTED_MODULE_1__[\\"a\\"], \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
if (typeof PRERENDER !== \\"undefined\\") {
global._prerender = inst;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
} ], [ [ 19, 0, 1, 3, 2 ] ] ]);

/** filePath: dist/pages/index/index.json **/
Expand Down Expand Up @@ -3003,7 +3007,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
} ], [ [ 19, 0, 1, 3, 2 ] ] ]);

/** filePath: dist/pages/index/index.json **/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,11 @@ require(\\"./taro\\");
var config = {
navigationBarTitleText: \\"\\\\u9996\\\\u9875\\"
};
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {}, config || {}));
var inst = Page(Object(taro_runtime[\\"createPageConfig\\"])(index_Index, \\"pages/index/index\\", {
root: {
cn: []
}
}, config || {}));
} ], [ [ 19, 0, 1, 3, 2 ] ] ]);

/** filePath: dist/pages/index/index.json **/
Expand Down
Loading

0 comments on commit ff4a10d

Please sign in to comment.