提交 0cc9b12a 编写于 作者: fxy060608's avatar fxy060608

chore: build

上级 683c8eff
......@@ -91,7 +91,10 @@ export function isEnableUniPushV2(inputDir: string, platform: UniApp.PLATFORM) {
return manifest[platform]?.unipush?.enable === true
}
export function isEnableSecureNetwork(inputDir: string, platform: UniApp.PLATFORM) {
export function isEnableSecureNetwork(
inputDir: string,
platform: UniApp.PLATFORM
) {
const manifest = parseManifestJsonOnce(inputDir)
if (platform === 'app') {
return false // 暂未支持app
......
......@@ -142,6 +142,19 @@ exports.default = () => [
return {
name: 'uni:cloud',
enforce: 'pre',
config(config, env) {
if ((0, uni_cli_shared_1.isSsr)(env.command, config)) {
return;
}
const inputDir = process.env.UNI_INPUT_DIR;
const platform = process.env.UNI_PLATFORM;
const isSecureNetworkEnabled = (0, uni_cli_shared_1.isEnableSecureNetwork)(inputDir, platform);
return {
define: {
'process.env.UNI_SECURE_NETWORK': isSecureNetworkEnabled,
},
};
},
transform(code, id) {
if (!opts.filter(id)) {
return;
......
......@@ -10,7 +10,7 @@ import {
uniViteInjectPlugin,
UniVitePlugin,
isInHBuilderX,
isEnableSecureNetwork
isEnableSecureNetwork,
} from '@dcloudio/uni-cli-shared'
import { uniValidateFunctionPlugin } from './validateFunction'
......
......@@ -761,6 +761,9 @@ function initCreatePage() {
__r: handleRef,
__l: handleLink,
};
if (isPlainObject(vueOptions.events)) {
extend(pageOptions.events, vueOptions.events);
}
if (__VUE_OPTIONS_API__) {
pageOptions.data = initData();
}
......
......@@ -27,7 +27,7 @@ import {
createVueComponent,
} from './util'
import { extend } from '@vue/shared'
import { extend, isPlainObject } from '@vue/shared'
declare function Page<D>(options: tinyapp.PageOptions<D>): void
......@@ -67,7 +67,9 @@ export function initCreatePage() {
__l: handleLink,
}
extend(pageOptions.events, vueOptions.events || {})
if (isPlainObject(vueOptions.events)) {
extend(pageOptions.events!, vueOptions.events)
}
if (__VUE_OPTIONS_API__) {
pageOptions.data = initData(vueOptions)
......
......@@ -1168,12 +1168,20 @@ function requestPayment(params) {
else {
swan.requestPolymerPayment(params);
}
}
function createIntersectionObserver(component, options) {
if (options && options.observeAll) {
options.selectAll = options.observeAll;
delete options.observeAll;
}
return swan.createIntersectionObserver(component, options);
}
var shims = /*#__PURE__*/Object.freeze({
__proto__: null,
getProvider: getProvider,
requestPayment: requestPayment
requestPayment: requestPayment,
createIntersectionObserver: createIntersectionObserver
});
function createTodoMethod(contextName, methodName) {
......
......@@ -36,4 +36,4 @@ export function createIntersectionObserver(
delete options.observeAll
}
return (swan as any).createIntersectionObserver(component, options)
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册