提交 a659c99d 编写于 作者: Q qiang

Merge branch 'dev' into alpha

......@@ -23,9 +23,13 @@ function parseUniExtApis(vite = true) {
if (!fs_extra_1.default.existsSync(pkgPath)) {
return;
}
const exports = (_b = (_a = JSON.parse(fs_extra_1.default.readFileSync(pkgPath, 'utf8'))) === null || _a === void 0 ? void 0 : _a.uni_modules) === null || _b === void 0 ? void 0 : _b['uni-ext-api'];
if (exports) {
Object.assign(injects, parseInjects(vite, process.env.UNI_PLATFORM === 'h5' ? 'web' : process.env.UNI_PLATFORM, `@/uni_modules/${uniModuleDir}`, exports));
try {
const exports = (_b = (_a = JSON.parse(fs_extra_1.default.readFileSync(pkgPath, 'utf8'))) === null || _a === void 0 ? void 0 : _a.uni_modules) === null || _b === void 0 ? void 0 : _b['uni-ext-api'];
if (exports) {
Object.assign(injects, parseInjects(vite, process.env.UNI_PLATFORM === 'h5' ? 'web' : process.env.UNI_PLATFORM, `@/uni_modules/${uniModuleDir}`, exports));
}
}
catch (e) {
}
});
return injects;
......
......@@ -20,6 +20,8 @@ function formatMessage (msg) {
return ''
}
const installPreprocessorTips = {}
function ModuleBuildError (err) {
const lines = err.message.split('\n')
let firstLineMessage = lines[0]
......@@ -78,6 +80,10 @@ function ModuleBuildError (err) {
builtinCompile = 'pug/jade'
}
if (builtinCompile) {
if (installPreprocessorTips[name]) {
return false
}
installPreprocessorTips[name] = true
installHBuilderXPlugin(name)
return {
message: '预编译器错误:代码使用了' + builtinCompile +
......
......@@ -82,21 +82,21 @@ export function useTabBarThemeChange (tabBar, options) {
export function useWebviewThemeChange (webview, getWebviewStyle) {
if (__uniConfig.darkmode) {
const fn = () => {
const {
animationAlphaBGColor, background,
backgroundColorBottom, backgroundColorTop,
titleNView: { backgroundColor, titleColor } = {}
} = getWebviewStyle()
webview && webview.setStyle({
animationAlphaBGColor,
background,
backgroundColorBottom,
backgroundColorTop,
titleNView: {
backgroundColor,
titleColor
}
})
const webviewStyle = getWebviewStyle()
const style = {
animationAlphaBGColor: webviewStyle.animationAlphaBGColor,
background: webviewStyle.background,
backgroundColorBottom: webviewStyle.backgroundColorBottom,
backgroundColorTop: webviewStyle.backgroundColorTop
}
var titleNView = webviewStyle.titleNView
if (typeof titleNView !== 'undefined') {
style.titleNView = typeof titleNView === 'object' ? {
backgroundColor: titleNView.backgroundColor,
titleColor: titleNView.titleColor
} : titleNView
}
webview && webview.setStyle(webviewStyle)
}
onThemeChange(fn)
webview.addEventListener('close', () => offThemeChange(fn))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册