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

chore: build

上级 683c8eff
...@@ -91,7 +91,10 @@ export function isEnableUniPushV2(inputDir: string, platform: UniApp.PLATFORM) { ...@@ -91,7 +91,10 @@ export function isEnableUniPushV2(inputDir: string, platform: UniApp.PLATFORM) {
return manifest[platform]?.unipush?.enable === true 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) const manifest = parseManifestJsonOnce(inputDir)
if (platform === 'app') { if (platform === 'app') {
return false // 暂未支持app return false // 暂未支持app
......
...@@ -142,6 +142,19 @@ exports.default = () => [ ...@@ -142,6 +142,19 @@ exports.default = () => [
return { return {
name: 'uni:cloud', name: 'uni:cloud',
enforce: 'pre', 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) { transform(code, id) {
if (!opts.filter(id)) { if (!opts.filter(id)) {
return; return;
......
...@@ -10,7 +10,7 @@ import { ...@@ -10,7 +10,7 @@ import {
uniViteInjectPlugin, uniViteInjectPlugin,
UniVitePlugin, UniVitePlugin,
isInHBuilderX, isInHBuilderX,
isEnableSecureNetwork isEnableSecureNetwork,
} from '@dcloudio/uni-cli-shared' } from '@dcloudio/uni-cli-shared'
import { uniValidateFunctionPlugin } from './validateFunction' import { uniValidateFunctionPlugin } from './validateFunction'
......
...@@ -761,6 +761,9 @@ function initCreatePage() { ...@@ -761,6 +761,9 @@ function initCreatePage() {
__r: handleRef, __r: handleRef,
__l: handleLink, __l: handleLink,
}; };
if (isPlainObject(vueOptions.events)) {
extend(pageOptions.events, vueOptions.events);
}
if (__VUE_OPTIONS_API__) { if (__VUE_OPTIONS_API__) {
pageOptions.data = initData(); pageOptions.data = initData();
} }
......
...@@ -27,7 +27,7 @@ import { ...@@ -27,7 +27,7 @@ import {
createVueComponent, createVueComponent,
} from './util' } from './util'
import { extend } from '@vue/shared' import { extend, isPlainObject } from '@vue/shared'
declare function Page<D>(options: tinyapp.PageOptions<D>): void declare function Page<D>(options: tinyapp.PageOptions<D>): void
...@@ -67,7 +67,9 @@ export function initCreatePage() { ...@@ -67,7 +67,9 @@ export function initCreatePage() {
__l: handleLink, __l: handleLink,
} }
extend(pageOptions.events, vueOptions.events || {}) if (isPlainObject(vueOptions.events)) {
extend(pageOptions.events!, vueOptions.events)
}
if (__VUE_OPTIONS_API__) { if (__VUE_OPTIONS_API__) {
pageOptions.data = initData(vueOptions) pageOptions.data = initData(vueOptions)
......
...@@ -1168,12 +1168,20 @@ function requestPayment(params) { ...@@ -1168,12 +1168,20 @@ function requestPayment(params) {
else { else {
swan.requestPolymerPayment(params); 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({ var shims = /*#__PURE__*/Object.freeze({
__proto__: null, __proto__: null,
getProvider: getProvider, getProvider: getProvider,
requestPayment: requestPayment requestPayment: requestPayment,
createIntersectionObserver: createIntersectionObserver
}); });
function createTodoMethod(contextName, methodName) { function createTodoMethod(contextName, methodName) {
......
...@@ -36,4 +36,4 @@ export function createIntersectionObserver( ...@@ -36,4 +36,4 @@ export function createIntersectionObserver(
delete options.observeAll delete options.observeAll
} }
return (swan as any).createIntersectionObserver(component, options) 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.
先完成此消息的编辑!
想要评论请 注册