提交 83a19f76 编写于 作者: fxy060608's avatar fxy060608

chore: bump vite from 2.9.14 to 3.1.3

上级 e2791d25
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
"compression": "^1.7.4", "compression": "^1.7.4",
"cypress": "^10.7.0", "cypress": "^10.7.0",
"serve-static": "^1.15.0", "serve-static": "^1.15.0",
"vite": "2.9.14" "vite": "3.1.3"
} }
} }
...@@ -182,6 +182,7 @@ declare namespace UniNamespace { ...@@ -182,6 +182,7 @@ declare namespace UniNamespace {
interface PagesJsonPagePlatformStyle { interface PagesJsonPagePlatformStyle {
h5?: PagesJsonPageStyle h5?: PagesJsonPageStyle
web?: PagesJsonPageStyle
app?: PagesJsonPageStyle app?: PagesJsonPageStyle
'app-plus'?: PagesJsonPageStyle 'app-plus'?: PagesJsonPageStyle
'mp-alipay'?: PagesJsonPageStyle 'mp-alipay'?: PagesJsonPageStyle
......
...@@ -16,6 +16,7 @@ export default { ...@@ -16,6 +16,7 @@ export default {
plugins: [terser()], plugins: [terser()],
output: { output: {
inlineDynamicImports: true, inlineDynamicImports: true,
entryFileNames: 'size-check.es.js',
}, },
}, },
}, },
......
import { isArray, hasOwn as hasOwn$1, isString, isPlainObject, isObject as isObject$1, toRawType, capitalize, makeMap, isFunction, isPromise, extend, remove, toTypeString } from '@vue/shared'; import { isArray, hasOwn as hasOwn$1, isString, isPlainObject, isObject as isObject$1, toRawType, capitalize, makeMap, isFunction, isPromise, extend, remove, toTypeString } from '@vue/shared';
import { LINEFEED, parseNVueDataset, once, I18N_JSON_DELIMITERS, Emitter, addLeadingSlash, resolveComponentInstance, invokeArrayFns, removeLeadingSlash, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, SCHEME_RE, DATA_RE, cacheStringFunction, formatLog, parseQuery, ON_ERROR, callOptions, ON_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, PRIMARY_COLOR, getLen, TABBAR_HEIGHT, NAVBAR_HEIGHT, sortObject, ON_THEME_CHANGE, ON_KEYBOARD_HEIGHT_CHANGE, BACKGROUND_COLOR, ON_NAVIGATION_BAR_BUTTON_TAP, stringifyQuery as stringifyQuery$1, debounce, ON_PULL_DOWN_REFRESH, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, ON_BACK_PRESS, UniNode, NODE_TYPE_PAGE, ACTION_TYPE_PAGE_CREATE, ACTION_TYPE_PAGE_CREATED, ACTION_TYPE_PAGE_SCROLL, ACTION_TYPE_INSERT, ACTION_TYPE_CREATE, ACTION_TYPE_REMOVE, ACTION_TYPE_ADD_EVENT, ACTION_TYPE_ADD_WXS_EVENT, ACTION_TYPE_REMOVE_EVENT, ACTION_TYPE_SET_ATTRIBUTE, ACTION_TYPE_REMOVE_ATTRIBUTE, ACTION_TYPE_SET_TEXT, ON_READY, ON_UNLOAD, EventChannel, ON_REACH_BOTTOM_DISTANCE, parseUrl, onCreateVueApp, ON_TAB_ITEM_TAP, ON_LAUNCH, ACTION_TYPE_EVENT, createUniEvent, ON_WXS_INVOKE_CALL_METHOD, WEB_INVOKE_APPSERVICE } from '@dcloudio/uni-shared'; import { LINEFEED, parseNVueDataset, once, I18N_JSON_DELIMITERS, Emitter, resolveComponentInstance, addLeadingSlash, invokeArrayFns, removeLeadingSlash, ON_RESIZE, ON_APP_ENTER_FOREGROUND, ON_APP_ENTER_BACKGROUND, ON_SHOW, ON_HIDE, ON_PAGE_SCROLL, ON_REACH_BOTTOM, SCHEME_RE, DATA_RE, cacheStringFunction, formatLog, parseQuery, ON_ERROR, callOptions, ON_UNHANDLE_REJECTION, ON_PAGE_NOT_FOUND, PRIMARY_COLOR, getLen, TABBAR_HEIGHT, NAVBAR_HEIGHT, sortObject, ON_THEME_CHANGE, ON_KEYBOARD_HEIGHT_CHANGE, BACKGROUND_COLOR, ON_NAVIGATION_BAR_BUTTON_TAP, stringifyQuery as stringifyQuery$1, debounce, ON_PULL_DOWN_REFRESH, ON_NAVIGATION_BAR_SEARCH_INPUT_CHANGED, ON_NAVIGATION_BAR_SEARCH_INPUT_CONFIRMED, ON_NAVIGATION_BAR_SEARCH_INPUT_CLICKED, ON_NAVIGATION_BAR_SEARCH_INPUT_FOCUS_CHANGED, ON_BACK_PRESS, UniNode, NODE_TYPE_PAGE, ACTION_TYPE_PAGE_CREATE, ACTION_TYPE_PAGE_CREATED, ACTION_TYPE_PAGE_SCROLL, ACTION_TYPE_INSERT, ACTION_TYPE_CREATE, ACTION_TYPE_REMOVE, ACTION_TYPE_ADD_EVENT, ACTION_TYPE_ADD_WXS_EVENT, ACTION_TYPE_REMOVE_EVENT, ACTION_TYPE_SET_ATTRIBUTE, ACTION_TYPE_REMOVE_ATTRIBUTE, ACTION_TYPE_SET_TEXT, ON_READY, ON_UNLOAD, EventChannel, ON_REACH_BOTTOM_DISTANCE, parseUrl, onCreateVueApp, ON_TAB_ITEM_TAP, ON_LAUNCH, ACTION_TYPE_EVENT, createUniEvent, ON_WXS_INVOKE_CALL_METHOD, WEB_INVOKE_APPSERVICE } from '@dcloudio/uni-shared';
import { ref, createVNode, render, injectHook, queuePostFlushCb, getCurrentInstance, onMounted, nextTick, onBeforeUnmount } from 'vue'; import { ref, createVNode, render, injectHook, queuePostFlushCb, getCurrentInstance, onMounted, nextTick, onBeforeUnmount } from 'vue';
/* /*
......
import { invokeArrayFns, ON_LOAD, ON_SHOW, LINEFEED, RENDERJS_MODULES, WXS_PROTOCOL, formatLog, WXS_MODULES, UniLifecycleHooks, ON_ERROR, invokeCreateErrorHandler, invokeCreateVueAppHook } from '@dcloudio/uni-shared'; import { invokeArrayFns, ON_LOAD, ON_SHOW, LINEFEED, RENDERJS_MODULES, formatLog, WXS_PROTOCOL, WXS_MODULES, UniLifecycleHooks, ON_ERROR, invokeCreateErrorHandler, invokeCreateVueAppHook } from '@dcloudio/uni-shared';
import { isString, isArray, isFunction } from '@vue/shared'; import { isString, isArray, isFunction } from '@vue/shared';
import { injectHook } from 'vue'; import { injectHook } from 'vue';
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
"@vue/compiler-sfc": "3.2.39", "@vue/compiler-sfc": "3.2.39",
"autoprefixer": "^10.4.12", "autoprefixer": "^10.4.12",
"pako": "^1.0.11", "pako": "^1.0.11",
"postcss": "^8.4.13", "postcss": "^8.4.16",
"vue": "3.2.39" "vue": "3.2.39"
}, },
"dependencies": { "dependencies": {
......
...@@ -26,21 +26,21 @@ ...@@ -26,21 +26,21 @@
"@dcloudio/uni-shared": "3.0.0-alpha-3060420220922001", "@dcloudio/uni-shared": "3.0.0-alpha-3060420220922001",
"@dcloudio/uts": "3.0.0-alpha-3060420220922001", "@dcloudio/uts": "3.0.0-alpha-3060420220922001",
"@rollup/pluginutils": "^4.2.0", "@rollup/pluginutils": "^4.2.0",
"@vitejs/plugin-vue": "^2.3.3", "@vitejs/plugin-vue": "^3.1.0",
"@vue/compiler-dom": "3.2.39", "@vue/compiler-dom": "3.2.39",
"@vue/compiler-sfc": "3.2.39", "@vue/compiler-sfc": "3.2.39",
"debug": "^4.3.3", "debug": "^4.3.3",
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",
"picocolors": "^1.0.0", "picocolors": "^1.0.0",
"rollup": "^2.59.0" "rollup": "~2.78.0"
}, },
"devDependencies": { "devDependencies": {
"@types/debug": "^4.1.7", "@types/debug": "^4.1.7",
"@types/fs-extra": "^9.0.13", "@types/fs-extra": "^9.0.13",
"@vue/compiler-core": "3.2.39", "@vue/compiler-core": "3.2.39",
"esbuild": "^0.14.27", "esbuild": "^0.15.9",
"postcss": "^8.4.13", "postcss": "^8.4.16",
"vite": "2.9.14", "vite": "3.1.3",
"vue": "3.2.39" "vue": "3.2.39"
} }
} }
import { isString, isFunction, isPromise, isArray, getGlobalThis, extend, NOOP, remove, EMPTY_OBJ, isObject, toHandlerKey, camelize, capitalize, EMPTY_ARR, normalizeClass, normalizeStyle, isOn, NO, hasChanged, hasOwn, hyphenate, toNumber, isSet, isMap, isPlainObject, invokeArrayFns, isBuiltInDirective, isReservedProp, makeMap, isModelListener, def, toRawType, parseStringStyle, isGloballyWhitelisted } from '@vue/shared'; import { isString, isFunction, isPromise, isArray, getGlobalThis, NOOP, remove, EMPTY_OBJ, toHandlerKey, camelize, capitalize, isObject, extend, normalizeClass, normalizeStyle, isOn, hasChanged, hasOwn, hyphenate, toNumber, isSet, isMap, isPlainObject, invokeArrayFns, EMPTY_ARR, NO, isModelListener, isBuiltInDirective, isReservedProp, makeMap, parseStringStyle, def, toRawType, isGloballyWhitelisted } from '@vue/shared';
export { camelize, capitalize, hyphenate, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared'; export { camelize, capitalize, hyphenate, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
import { pauseTracking, resetTracking, isRef, toRaw, isShallow as isShallow$1, isReactive, ReactiveEffect, ref, isProxy, proxyRefs, markRaw, computed as computed$1, shallowReadonly, EffectScope, track, isReadonly, reactive, shallowReactive, trigger } from '@vue/reactivity'; import { pauseTracking, resetTracking, isRef, toRaw, isShallow as isShallow$1, isReactive, ReactiveEffect, ref, isProxy, computed as computed$1, shallowReadonly, proxyRefs, markRaw, isReadonly, track, EffectScope, reactive, shallowReactive, trigger } from '@vue/reactivity';
export { EffectScope, ReactiveEffect, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity'; export { EffectScope, ReactiveEffect, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity';
import { isRootHook, isRootImmediateHook, ON_LOAD } from '@dcloudio/uni-shared'; import { isRootHook, isRootImmediateHook, ON_LOAD } from '@dcloudio/uni-shared';
var stack = []; var stack = [];
......
import { isString, isFunction, isPromise, isArray, NOOP, remove, EMPTY_OBJ, camelize, capitalize, isObject, toHandlerKey, getGlobalThis, EMPTY_ARR, normalizeClass, extend, normalizeStyle, isOn, hasChanged, hasOwn, hyphenate, toNumber, isSet, isMap, isPlainObject, invokeArrayFns, NO, isReservedProp, isModelListener, def, parseStringStyle, isGloballyWhitelisted } from '@vue/shared'; import { isString, isFunction, isPromise, isArray, NOOP, remove, EMPTY_OBJ, camelize, capitalize, isObject, toHandlerKey, getGlobalThis, normalizeClass, extend, normalizeStyle, isOn, hasChanged, hasOwn, hyphenate, toNumber, isSet, isMap, isPlainObject, invokeArrayFns, EMPTY_ARR, isModelListener, isReservedProp, parseStringStyle, def, NO, isGloballyWhitelisted } from '@vue/shared';
export { camelize, capitalize, hyphenate, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared'; export { camelize, capitalize, hyphenate, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
import { pauseTracking, resetTracking, isRef, toRaw, isShallow, isReactive, ReactiveEffect, ref, isProxy, proxyRefs, markRaw, computed as computed$1, EffectScope, track, reactive, shallowReactive, trigger } from '@vue/reactivity'; import { pauseTracking, resetTracking, isRef, toRaw, isShallow, isReactive, ReactiveEffect, ref, isProxy, computed as computed$1, proxyRefs, markRaw, EffectScope, track, reactive, shallowReactive, trigger } from '@vue/reactivity';
export { EffectScope, ReactiveEffect, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity'; export { EffectScope, ReactiveEffect, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity';
import { isRootHook, isRootImmediateHook, ON_LOAD } from '@dcloudio/uni-shared'; import { isRootHook, isRootImmediateHook, ON_LOAD } from '@dcloudio/uni-shared';
var stack = []; var stack = [];
......
import { extend, isObject, toRawType, def, hasChanged, isArray, isString, isFunction, isPromise, getGlobalThis, NOOP, remove, EMPTY_OBJ, toHandlerKey, camelize, capitalize, EMPTY_ARR, normalizeClass, normalizeStyle, isOn, NO, toNumber, hyphenate, invokeArrayFns, looseIndexOf, isSet, looseEqual, isHTMLTag, isSVGTag, isMap, isPlainObject, isBuiltInDirective, isReservedProp, makeMap, hasOwn, isModelListener, isIntegerKey, isSymbol, isGloballyWhitelisted, isSpecialBooleanAttr, includeBooleanAttr } from '@vue/shared'; import { extend, isObject, def, hasChanged, isArray, isString, isFunction, isPromise, getGlobalThis, NOOP, remove, EMPTY_OBJ, toHandlerKey, camelize, capitalize, normalizeClass, normalizeStyle, isOn, toNumber, hyphenate, looseIndexOf, isSet, looseEqual, isHTMLTag, isSVGTag, toRawType, isMap, isPlainObject, invokeArrayFns, EMPTY_ARR, NO, isModelListener, isBuiltInDirective, hasOwn, isReservedProp, makeMap, isSymbol, isIntegerKey, isGloballyWhitelisted, isSpecialBooleanAttr, includeBooleanAttr } from '@vue/shared';
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared'; export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
function warn(msg, ...args) { function warn(msg, ...args) {
......
import { isRootHook, isRootImmediateHook, ON_LOAD, UniInputElement, UniTextAreaElement, UniElement, UniTextNode, UniCommentNode, forcePatchProp, resolveOwnerEl, ATTR_V_OWNER_ID, ATTR_V_RENDERJS, JSON_PROTOCOL } from '@dcloudio/uni-shared'; import { isRootHook, isRootImmediateHook, ON_LOAD, UniInputElement, UniTextAreaElement, UniElement, UniTextNode, UniCommentNode, forcePatchProp, JSON_PROTOCOL, resolveOwnerEl, ATTR_V_OWNER_ID, ATTR_V_RENDERJS } from '@dcloudio/uni-shared';
import { isString, isFunction, isPromise, isArray, getGlobalThis, extend, NOOP, remove, EMPTY_OBJ, isObject, toHandlerKey, camelize, capitalize, EMPTY_ARR, normalizeClass, normalizeStyle, isOn, NO, hasChanged, toNumber, invokeArrayFns, hyphenate, isHTMLTag, isSVGTag, isSet, isMap, isPlainObject, isBuiltInDirective, isReservedProp, makeMap, isModelListener, hasOwn, def, toRawType, isGloballyWhitelisted } from '@vue/shared'; import { isString, isFunction, isPromise, isArray, getGlobalThis, NOOP, remove, EMPTY_OBJ, toHandlerKey, camelize, capitalize, isObject, extend, normalizeClass, normalizeStyle, isOn, hasChanged, toNumber, hyphenate, isHTMLTag, isSVGTag, isSet, isMap, isPlainObject, invokeArrayFns, EMPTY_ARR, NO, isModelListener, isBuiltInDirective, hasOwn, isReservedProp, makeMap, def, toRawType, isGloballyWhitelisted } from '@vue/shared';
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared'; export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
import { pauseTracking, resetTracking, isRef, toRaw, isShallow as isShallow$1, isReactive, ReactiveEffect, ref, isProxy, proxyRefs, markRaw, computed as computed$1, shallowReadonly, EffectScope, track, isReadonly, reactive, shallowReactive, trigger } from '@vue/reactivity'; import { pauseTracking, resetTracking, isRef, toRaw, isShallow as isShallow$1, isReactive, ReactiveEffect, ref, isProxy, computed as computed$1, shallowReadonly, proxyRefs, markRaw, isReadonly, track, EffectScope, reactive, shallowReactive, trigger } from '@vue/reactivity';
export { EffectScope, ReactiveEffect, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity'; export { EffectScope, ReactiveEffect, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity';
var stack = []; var stack = [];
......
import { isRootHook, isRootImmediateHook, ON_LOAD, UniInputElement, UniTextAreaElement, UniElement, UniTextNode, UniCommentNode, forcePatchProp, resolveOwnerEl, ATTR_V_OWNER_ID, ATTR_V_RENDERJS, JSON_PROTOCOL } from '@dcloudio/uni-shared'; import { isRootHook, isRootImmediateHook, ON_LOAD, UniInputElement, UniTextAreaElement, UniElement, UniTextNode, UniCommentNode, forcePatchProp, JSON_PROTOCOL, resolveOwnerEl, ATTR_V_OWNER_ID, ATTR_V_RENDERJS } from '@dcloudio/uni-shared';
import { isString, isFunction, isPromise, isArray, NOOP, remove, EMPTY_OBJ, camelize, capitalize, isObject, toHandlerKey, getGlobalThis, EMPTY_ARR, normalizeClass, extend, normalizeStyle, isOn, hasChanged, toNumber, invokeArrayFns, hyphenate, isSet, isMap, isPlainObject, NO, isReservedProp, isModelListener, hasOwn, def, isGloballyWhitelisted } from '@vue/shared'; import { isString, isFunction, isPromise, isArray, NOOP, remove, EMPTY_OBJ, camelize, capitalize, isObject, toHandlerKey, getGlobalThis, normalizeClass, extend, normalizeStyle, isOn, hasChanged, toNumber, hyphenate, isSet, isMap, isPlainObject, invokeArrayFns, EMPTY_ARR, isModelListener, isReservedProp, hasOwn, def, NO, isGloballyWhitelisted } from '@vue/shared';
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared'; export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
import { pauseTracking, resetTracking, isRef, toRaw, isShallow, isReactive, ReactiveEffect, ref, isProxy, proxyRefs, markRaw, computed as computed$1, EffectScope, track, reactive, shallowReactive, trigger } from '@vue/reactivity'; import { pauseTracking, resetTracking, isRef, toRaw, isShallow, isReactive, ReactiveEffect, ref, isProxy, computed as computed$1, proxyRefs, markRaw, EffectScope, track, reactive, shallowReactive, trigger } from '@vue/reactivity';
export { EffectScope, ReactiveEffect, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity'; export { EffectScope, ReactiveEffect, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, triggerRef, unref } from '@vue/reactivity';
var stack = []; var stack = [];
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
"compare-versions": "^3.6.0", "compare-versions": "^3.6.0",
"debug": "^4.3.3", "debug": "^4.3.3",
"es-module-lexer": "^0.9.3", "es-module-lexer": "^0.9.3",
"esbuild": "^0.14.27", "esbuild": "^0.15.9",
"estree-walker": "^2.0.2", "estree-walker": "^2.0.2",
"fast-glob": "^3.2.11", "fast-glob": "^3.2.11",
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
"@types/resolve": "^1.20.2", "@types/resolve": "^1.20.2",
"@types/sass": "^1.43.1", "@types/sass": "^1.43.1",
"@types/stylus": "^0.48.36", "@types/stylus": "^0.48.36",
"postcss": "^8.4.13", "postcss": "^8.4.16",
"vue": "3.2.39" "vue": "3.2.39"
} }
} }
...@@ -22,9 +22,9 @@ function createDefineJsonJsPlugin(name: 'pages.json' | 'manifest.json') { ...@@ -22,9 +22,9 @@ function createDefineJsonJsPlugin(name: 'pages.json' | 'manifest.json') {
} as UniViteFilterPluginOptions } as UniViteFilterPluginOptions
const plugin = createVitePlugin(opts) const plugin = createVitePlugin(opts)
const origLoad = plugin.load const origLoad = plugin.load as Function
const origResolveId = plugin.resolveId const origResolveId = plugin.resolveId as Function
const origConfigResolved = plugin.configResolved const origConfigResolved = plugin.configResolved as Function
let jsonPath = '' let jsonPath = ''
let jsonJsPath = '' let jsonJsPath = ''
......
...@@ -17,7 +17,7 @@ export function defineUniMainJsPlugin( ...@@ -17,7 +17,7 @@ export function defineUniMainJsPlugin(
} as UniViteFilterPluginOptions } as UniViteFilterPluginOptions
const plugin = createUniMainJsPlugin(opts) const plugin = createUniMainJsPlugin(opts)
const origConfigResolved = plugin.configResolved const origConfigResolved = plugin.configResolved as Function
let mainJsPath = '' let mainJsPath = ''
let mainTsPath = '' let mainTsPath = ''
......
...@@ -702,7 +702,7 @@ function combineSourcemapsIfExists( ...@@ -702,7 +702,7 @@ function combineSourcemapsIfExists(
interface PostCSSConfigResult { interface PostCSSConfigResult {
options: Postcss.ProcessOptions options: Postcss.ProcessOptions
plugins: Postcss.Plugin[] plugins: Postcss.AcceptedPlugin[]
} }
async function resolvePostcssConfig( async function resolvePostcssConfig(
......
import { createElementVNode, defineComponent, createVNode, mergeProps, getCurrentInstance, provide, watch, onUnmounted, shallowRef, reactive, watchEffect, ref, inject, onBeforeUnmount, computed, Text as Text$1, isVNode, Fragment, onMounted, nextTick, Comment, resolveComponent, parseClassList } from "vue"; import { createElementVNode, defineComponent, createVNode, mergeProps, getCurrentInstance, provide, watch, onUnmounted, shallowRef, reactive, watchEffect, ref, inject, onBeforeUnmount, computed, Text as Text$1, isVNode, Fragment, onMounted, nextTick, Comment, resolveComponent, parseClassList } from "vue";
import { extend, hasOwn, isFunction, isPlainObject, isArray, isString } from "@vue/shared"; import { hasOwn, extend, isFunction, isPlainObject, isArray, isString } from "@vue/shared";
import { cacheStringFunction, PRIMARY_COLOR } from "@dcloudio/uni-shared"; import { cacheStringFunction, PRIMARY_COLOR } from "@dcloudio/uni-shared";
const OPEN_TYPES = [ const OPEN_TYPES = [
"navigate", "navigate",
...@@ -81,7 +81,9 @@ const navigatorProps = { ...@@ -81,7 +81,9 @@ const navigatorProps = {
function createNavigatorOnClick(props2) { function createNavigatorOnClick(props2) {
return () => { return () => {
if (props2.openType !== "navigateBack" && !props2.url) { if (props2.openType !== "navigateBack" && !props2.url) {
console.error("<navigator/> should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab"); console.error(
"<navigator/> should have url attribute when using navigateTo, redirectTo, reLaunch or switchTab"
);
return; return;
} }
const animationDuration = parseInt(props2.animationDuration); const animationDuration = parseInt(props2.animationDuration);
...@@ -136,7 +138,11 @@ function useHoverClass(props2) { ...@@ -136,7 +138,11 @@ function useHoverClass(props2) {
return {}; return {};
} }
function createNVueTextVNode(text, attrs) { function createNVueTextVNode(text, attrs) {
return createElementVNode("u-text", extend({ appendAsTree: true }, attrs), text); return createElementVNode(
"u-text",
extend({ appendAsTree: true }, attrs),
text
);
} }
const navigatorStyles = [{ const navigatorStyles = [{
"navigator-hover": { "navigator-hover": {
...@@ -146,7 +152,7 @@ const navigatorStyles = [{ ...@@ -146,7 +152,7 @@ const navigatorStyles = [{
} }
} }
}]; }];
var Navigator = defineComponent({ const Navigator = defineComponent({
name: "Navigator", name: "Navigator",
props: navigatorProps, props: navigatorProps,
styles: navigatorStyles, styles: navigatorStyles,
...@@ -211,11 +217,13 @@ class Page { ...@@ -211,11 +217,13 @@ class Page {
this.webview = webview; this.webview = webview;
} }
sendMessage(data) { sendMessage(data) {
const message = JSON.parse(JSON.stringify({ const message = JSON.parse(
__message: { JSON.stringify({
data __message: {
} data
})); }
})
);
const id = this.webview.id; const id = this.webview.id;
if (BroadcastChannel_) { if (BroadcastChannel_) {
const channel2 = new BroadcastChannel_(id); const channel2 = new BroadcastChannel_(id);
...@@ -302,7 +310,7 @@ function useProvideLabel() { ...@@ -302,7 +310,7 @@ function useProvideLabel() {
}); });
return handlers; return handlers;
} }
var Label = /* @__PURE__ */ defineComponent({ const Label = /* @__PURE__ */ defineComponent({
name: "Label", name: "Label",
props: labelProps, props: labelProps,
styles: [], styles: [],
...@@ -325,10 +333,13 @@ var Label = /* @__PURE__ */ defineComponent({ ...@@ -325,10 +333,13 @@ var Label = /* @__PURE__ */ defineComponent({
}); });
function useListeners(props2, listeners) { function useListeners(props2, listeners) {
_addListeners(props2.id, listeners); _addListeners(props2.id, listeners);
watch(() => props2.id, (newId, oldId) => { watch(
_removeListeners(oldId, listeners, true); () => props2.id,
_addListeners(newId, listeners, true); (newId, oldId) => {
}); _removeListeners(oldId, listeners, true);
_addListeners(newId, listeners, true);
}
);
onUnmounted(() => { onUnmounted(() => {
_removeListeners(props2.id, listeners); _removeListeners(props2.id, listeners);
}); });
...@@ -391,23 +402,26 @@ const useAttrs = (params = {}) => { ...@@ -391,23 +402,26 @@ const useAttrs = (params = {}) => {
const allExcludeKeys = excludeKeys.concat(DEFAULT_EXCLUDE_KEYS); const allExcludeKeys = excludeKeys.concat(DEFAULT_EXCLUDE_KEYS);
instance.attrs = reactive(instance.attrs); instance.attrs = reactive(instance.attrs);
watchEffect(() => { watchEffect(() => {
const res = entries(instance.attrs).reduce((acc, [key, val]) => { const res = entries(instance.attrs).reduce(
if (allExcludeKeys.includes(key)) { (acc, [key, val]) => {
acc.exclude[key] = val; if (allExcludeKeys.includes(key)) {
} else if (LISTENER_PREFIX.test(key)) { acc.exclude[key] = val;
if (!excludeListeners) { } else if (LISTENER_PREFIX.test(key)) {
if (!excludeListeners) {
acc.attrs[key] = val;
}
acc.listeners[key] = val;
} else {
acc.attrs[key] = val; acc.attrs[key] = val;
} }
acc.listeners[key] = val; return acc;
} else { },
acc.attrs[key] = val; {
exclude: {},
attrs: {},
listeners: {}
} }
return acc; );
}, {
exclude: {},
attrs: {},
listeners: {}
});
attrs.value = res.attrs; attrs.value = res.attrs;
listeners.value = res.listeners; listeners.value = res.listeners;
excludeAttrs.value = res.exclude; excludeAttrs.value = res.exclude;
...@@ -725,7 +739,7 @@ const TYPES = { ...@@ -725,7 +739,7 @@ const TYPES = {
primary: "p", primary: "p",
warn: "w" warn: "w"
}; };
var Button = defineComponent({ const Button = defineComponent({
inheritAttrs: false, inheritAttrs: false,
name: "Button", name: "Button",
props: extend(buttonProps, { props: extend(buttonProps, {
...@@ -886,7 +900,7 @@ const getComponentSize = (el) => { ...@@ -886,7 +900,7 @@ const getComponentSize = (el) => {
}); });
}); });
}; };
var MovableArea = defineComponent({ const MovableArea = defineComponent({
name: "MovableArea", name: "MovableArea",
props: movableAreaProps, props: movableAreaProps,
styles: [{ styles: [{
...@@ -1033,7 +1047,12 @@ function useTouchtrack(method) { ...@@ -1033,7 +1047,12 @@ function useTouchtrack(method) {
}); });
addListener("touchmove", function($event) { addListener("touchmove", function($event) {
if ($eventOld) { if ($eventOld) {
const res = fn($event, "move", $event.touches[0].pageX, $event.touches[0].pageY); const res = fn(
$event,
"move",
$event.touches[0].pageX,
$event.touches[0].pageY
);
x1 = $event.touches[0].pageX; x1 = $event.touches[0].pageX;
y1 = $event.touches[0].pageY; y1 = $event.touches[0].pageY;
return res; return res;
...@@ -1042,7 +1061,12 @@ function useTouchtrack(method) { ...@@ -1042,7 +1061,12 @@ function useTouchtrack(method) {
addListener("touchend", function($event) { addListener("touchend", function($event) {
if ($eventOld) { if ($eventOld) {
$eventOld = null; $eventOld = null;
return fn($event, "end", $event.changedTouches[0].pageX, $event.changedTouches[0].pageY); return fn(
$event,
"end",
$event.changedTouches[0].pageX,
$event.changedTouches[0].pageY
);
} }
}); });
return { return {
...@@ -1125,7 +1149,7 @@ Friction.prototype.setS = function(x, y) { ...@@ -1125,7 +1149,7 @@ Friction.prototype.setS = function(x, y) {
this._y_s = y; this._y_s = y;
}; };
Friction.prototype.s = function(t2) { Friction.prototype.s = function(t2) {
if (t2 === void 0) { if (void 0 === t2) {
t2 = (new Date().getTime() - this._startTime) / 1e3; t2 = (new Date().getTime() - this._startTime) / 1e3;
} }
if (t2 > this._t) { if (t2 > this._t) {
...@@ -1146,7 +1170,7 @@ Friction.prototype.s = function(t2) { ...@@ -1146,7 +1170,7 @@ Friction.prototype.s = function(t2) {
}; };
}; };
Friction.prototype.ds = function(t2) { Friction.prototype.ds = function(t2) {
if (t2 === void 0) { if (void 0 === t2) {
t2 = (new Date().getTime() - this._startTime) / 1e3; t2 = (new Date().getTime() - this._startTime) / 1e3;
} }
if (t2 > this._t) { if (t2 > this._t) {
...@@ -1263,13 +1287,13 @@ Spring.prototype._solve = function(e2, t2) { ...@@ -1263,13 +1287,13 @@ Spring.prototype._solve = function(e2, t2) {
}; };
}; };
Spring.prototype.x = function(e2) { Spring.prototype.x = function(e2) {
if (e2 === void 0) { if (void 0 === e2) {
e2 = (new Date().getTime() - this._startTime) / 1e3; e2 = (new Date().getTime() - this._startTime) / 1e3;
} }
return this._solution ? this._endPosition + this._solution.x(e2) : 0; return this._solution ? this._endPosition + this._solution.x(e2) : 0;
}; };
Spring.prototype.dx = function(e2) { Spring.prototype.dx = function(e2) {
if (e2 === void 0) { if (void 0 === e2) {
e2 = (new Date().getTime() - this._startTime) / 1e3; e2 = (new Date().getTime() - this._startTime) / 1e3;
} }
return this._solution ? this._solution.dx(e2) : 0; return this._solution ? this._solution.dx(e2) : 0;
...@@ -1495,7 +1519,7 @@ function cancelAnimationFrame(id) { ...@@ -1495,7 +1519,7 @@ function cancelAnimationFrame(id) {
clearTimeout(id); clearTimeout(id);
} }
const animation = weex.requireModule("animation"); const animation = weex.requireModule("animation");
var MovableView = defineComponent({ const MovableView = defineComponent({
name: "MovableView", name: "MovableView",
props: movableViewProps, props: movableViewProps,
emits: ["change", "scale"], emits: ["change", "scale"],
...@@ -2109,7 +2133,7 @@ const progressStyles = [{ ...@@ -2109,7 +2133,7 @@ const progressStyles = [{
} }
} }
}]; }];
var Progress = defineComponent({ const Progress = defineComponent({
name: "Progress", name: "Progress",
props: progressProps, props: progressProps,
styles: progressStyles, styles: progressStyles,
...@@ -2256,7 +2280,7 @@ const nvuePickerViewProps = extend({}, pickerViewProps, { ...@@ -2256,7 +2280,7 @@ const nvuePickerViewProps = extend({}, pickerViewProps, {
default: "" default: ""
} }
}); });
var PickerView = defineComponent({ const PickerView = defineComponent({
name: "PickerView", name: "PickerView",
props: nvuePickerViewProps, props: nvuePickerViewProps,
emits: ["change", "update:value"], emits: ["change", "update:value"],
...@@ -2363,7 +2387,7 @@ const props$2 = { ...@@ -2363,7 +2387,7 @@ const props$2 = {
default: 0 default: 0
} }
}; };
var PickerViewColumn = defineComponent({ const PickerViewColumn = defineComponent({
name: "PickerViewColumn", name: "PickerViewColumn",
props: props$2, props: props$2,
data: () => ({ data: () => ({
...@@ -2698,7 +2722,7 @@ const props$1 = { ...@@ -2698,7 +2722,7 @@ const props$1 = {
default: false default: false
} }
}; };
var Picker = /* @__PURE__ */ defineComponent({ const Picker = /* @__PURE__ */ defineComponent({
name: "Picker", name: "Picker",
props: props$1, props: props$1,
emits: ["change", "cancel", "columnchange"], emits: ["change", "cancel", "columnchange"],
...@@ -2995,7 +3019,7 @@ const slierStyles = [{ ...@@ -2995,7 +3019,7 @@ const slierStyles = [{
} }
} }
}]; }];
var USlider = defineComponent({ const USlider = defineComponent({
name: "USlider", name: "USlider",
props: sliderProps, props: sliderProps,
styles: slierStyles, styles: slierStyles,
...@@ -3198,7 +3222,7 @@ const DCSwitchSize = { ...@@ -3198,7 +3222,7 @@ const DCSwitchSize = {
width: 52, width: 52,
height: 32 height: 32
}; };
var Switch = defineComponent({ const Switch = defineComponent({
name: "Switch", name: "Switch",
props: switchProps, props: switchProps,
emits: ["change"], emits: ["change"],
...@@ -3362,7 +3386,7 @@ const checkboxStyles = [{ ...@@ -3362,7 +3386,7 @@ const checkboxStyles = [{
} }
} }
}]; }];
var Checkbox = defineComponent({ const Checkbox = defineComponent({
name: "Checkbox", name: "Checkbox",
props: checkboxProps, props: checkboxProps,
styles: checkboxStyles, styles: checkboxStyles,
...@@ -3459,7 +3483,7 @@ function useCheckboxInject(checkboxChecked, checkboxValue, reset) { ...@@ -3459,7 +3483,7 @@ function useCheckboxInject(checkboxChecked, checkboxValue, reset) {
uniLabel uniLabel
}; };
} }
var CheckboxGroup = defineComponent({ const CheckboxGroup = defineComponent({
name: "CheckboxGroup", name: "CheckboxGroup",
props: checkboxGroupProps, props: checkboxGroupProps,
emits: ["change"], emits: ["change"],
...@@ -3586,7 +3610,7 @@ const radioStyles = [{ ...@@ -3586,7 +3610,7 @@ const radioStyles = [{
} }
} }
}]; }];
var Radio = defineComponent({ const Radio = defineComponent({
name: "Radio", name: "Radio",
props: radioProps, props: radioProps,
styles: radioStyles, styles: radioStyles,
...@@ -3705,7 +3729,7 @@ function useRadioInject(radioChecked, radioValue, reset) { ...@@ -3705,7 +3729,7 @@ function useRadioInject(radioChecked, radioValue, reset) {
field field
}; };
} }
var RadioGroup = defineComponent({ const RadioGroup = defineComponent({
name: "RadioGroup", name: "RadioGroup",
props: radioGroupProps, props: radioGroupProps,
emits: ["change"], emits: ["change"],
...@@ -3783,7 +3807,7 @@ function useProvideRadioGroup(props2, trigger) { ...@@ -3783,7 +3807,7 @@ function useProvideRadioGroup(props2, trigger) {
return fields2; return fields2;
} }
const NATIVE_COMPONENTS = ["u-input", "u-textarea"]; const NATIVE_COMPONENTS = ["u-input", "u-textarea"];
var Form = defineComponent({ const Form = defineComponent({
name: "Form", name: "Form",
emits: ["submit", "reset"], emits: ["submit", "reset"],
setup({}, { setup({}, {
...@@ -3904,7 +3928,7 @@ const iconStyles = [{ ...@@ -3904,7 +3928,7 @@ const iconStyles = [{
} }
} }
}]; }];
var Icon = defineComponent({ const Icon = defineComponent({
name: "Icon", name: "Icon",
props: iconProps, props: iconProps,
styles: iconStyles, styles: iconStyles,
...@@ -4009,7 +4033,7 @@ const swiperStyles = [{ ...@@ -4009,7 +4033,7 @@ const swiperStyles = [{
} }
} }
}]; }];
var Swiper = defineComponent({ const Swiper = defineComponent({
name: "Swiper", name: "Swiper",
props: swiperProps, props: swiperProps,
styles: swiperStyles, styles: swiperStyles,
...@@ -4172,7 +4196,7 @@ const swiperItemProps = { ...@@ -4172,7 +4196,7 @@ const swiperItemProps = {
default: "" default: ""
} }
}; };
var SwiperItem = defineComponent({ const SwiperItem = defineComponent({
name: "SwiperItem", name: "SwiperItem",
props: swiperItemProps, props: swiperItemProps,
setup(props2, { setup(props2, {
...@@ -4196,11 +4220,21 @@ var SwiperItem = defineComponent({ ...@@ -4196,11 +4220,21 @@ var SwiperItem = defineComponent({
var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/; var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;
var endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/; var endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/;
var attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; var attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g;
var empty = /* @__PURE__ */ makeMap("area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"); var empty = /* @__PURE__ */ makeMap(
var block = /* @__PURE__ */ makeMap("a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"); "area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr"
var inline = /* @__PURE__ */ makeMap("abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"); );
var closeSelf = /* @__PURE__ */ makeMap("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"); var block = /* @__PURE__ */ makeMap(
var fillAttrs = /* @__PURE__ */ makeMap("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"); "a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"
);
var inline = /* @__PURE__ */ makeMap(
"abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"
);
var closeSelf = /* @__PURE__ */ makeMap(
"colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"
);
var fillAttrs = /* @__PURE__ */ makeMap(
"checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"
);
var special = /* @__PURE__ */ makeMap("script,style"); var special = /* @__PURE__ */ makeMap("script,style");
function HTMLParser(html, handler) { function HTMLParser(html, handler) {
var index; var index;
...@@ -4247,13 +4281,19 @@ function HTMLParser(html, handler) { ...@@ -4247,13 +4281,19 @@ function HTMLParser(html, handler) {
} }
} }
} else { } else {
html = html.replace(new RegExp("([\\s\\S]*?)</" + stack.last() + "[^>]*>"), function(all, text2) { html = html.replace(
text2 = text2.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, "$1$2"); new RegExp("([\\s\\S]*?)</" + stack.last() + "[^>]*>"),
if (handler.chars) { function(all, text2) {
handler.chars(text2); text2 = text2.replace(
/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g,
"$1$2"
);
if (handler.chars) {
handler.chars(text2);
}
return "";
} }
return ""; );
});
parseEndTag("", stack.last()); parseEndTag("", stack.last());
} }
if (html == last) { if (html == last) {
...@@ -4418,7 +4458,7 @@ const props = { ...@@ -4418,7 +4458,7 @@ const props = {
} }
}; };
const defaultFontSize = 16; const defaultFontSize = 16;
var RichText = defineComponent({ const RichText = defineComponent({
name: "RichText", name: "RichText",
props, props,
setup(props2) { setup(props2) {
...@@ -4592,16 +4632,20 @@ function getAdData$1(data, onsuccess, onerror) { ...@@ -4592,16 +4632,20 @@ function getAdData$1(data, onsuccess, onerror) {
onsuccess(adDataList.splice(0, 1)[0]); onsuccess(adDataList.splice(0, 1)[0]);
return; return;
} }
plus.ad.getAds(data, (res) => { plus.ad.getAds(
const list = res.ads; data,
onsuccess(list.splice(0, 1)[0]); (res) => {
_adDataCache$1[key] = adDataList ? adDataList.concat(list) : list; const list = res.ads;
}, (err) => { onsuccess(list.splice(0, 1)[0]);
onerror({ _adDataCache$1[key] = adDataList ? adDataList.concat(list) : list;
errCode: err.code, },
errMsg: err.message (err) => {
}); onerror({
}); errCode: err.code,
errMsg: err.message
});
}
);
} }
const adProps = { const adProps = {
adpid: { adpid: {
...@@ -4627,7 +4671,7 @@ const AdEventType$1 = { ...@@ -4627,7 +4671,7 @@ const AdEventType$1 = {
error: "error", error: "error",
downloadchange: "downloadchange" downloadchange: "downloadchange"
}; };
var Ad = defineComponent({ const Ad = defineComponent({
name: "Ad", name: "Ad",
props: adProps, props: adProps,
emits: [AdEventType$1.load, AdEventType$1.close, AdEventType$1.error, AdEventType$1.downloadchange], emits: [AdEventType$1.load, AdEventType$1.close, AdEventType$1.error, AdEventType$1.downloadchange],
...@@ -4698,20 +4742,24 @@ function getAdData(adpid, width, height, onsuccess, onerror) { ...@@ -4698,20 +4742,24 @@ function getAdData(adpid, width, height, onsuccess, onerror) {
onsuccess(adDataList.splice(0, 1)[0]); onsuccess(adDataList.splice(0, 1)[0]);
return; return;
} }
plus.ad.getDrawAds({ plus.ad.getDrawAds(
adpid: String(adpid), {
count: 3, adpid: String(adpid),
width count: 3,
}, (res) => { width
const list = res.ads; },
onsuccess(list.splice(0, 1)[0]); (res) => {
_adDataCache[key] = adDataList ? adDataList.concat(list) : list; const list = res.ads;
}, (err) => { onsuccess(list.splice(0, 1)[0]);
onerror({ _adDataCache[key] = adDataList ? adDataList.concat(list) : list;
errCode: err.code, },
errMsg: err.message (err) => {
}); onerror({
}); errCode: err.code,
errMsg: err.message
});
}
);
} }
const adDrawProps = { const adDrawProps = {
adpid: { adpid: {
...@@ -4732,7 +4780,7 @@ const AdEventType = { ...@@ -4732,7 +4780,7 @@ const AdEventType = {
close: "close", close: "close",
error: "error" error: "error"
}; };
var AdDraw = defineComponent({ const AdDraw = defineComponent({
name: "AdDraw", name: "AdDraw",
props: adDrawProps, props: adDrawProps,
emits: [AdEventType.load, AdEventType.close, AdEventType.error], emits: [AdEventType.load, AdEventType.close, AdEventType.error],
...@@ -4795,7 +4843,7 @@ function _loadAdData(state, props2, trigger) { ...@@ -4795,7 +4843,7 @@ function _loadAdData(state, props2, trigger) {
trigger(AdEventType.error, err); trigger(AdEventType.error, err);
}); });
} }
var components = { const components = {
Navigator, Navigator,
Label, Label,
Button, Button,
...@@ -4819,4 +4867,6 @@ var components = { ...@@ -4819,4 +4867,6 @@ var components = {
Ad, Ad,
AdDraw AdDraw
}; };
export { components as default }; export {
components as default
};
[ [
"onCreateVueApp",
"$emit", "$emit",
"$off", "$off",
"$on", "$on",
...@@ -93,6 +92,7 @@ ...@@ -93,6 +92,7 @@
"onAppHide", "onAppHide",
"onAppShow", "onAppShow",
"onCompassChange", "onCompassChange",
"onCreateVueApp",
"onError", "onError",
"onGyroscopeChange", "onGyroscopeChange",
"onLocaleChange", "onLocaleChange",
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
"@types/module-alias": "^2.0.1", "@types/module-alias": "^2.0.1",
"@types/resolve": "^1.20.2", "@types/resolve": "^1.20.2",
"@vue/compiler-core": "3.2.39", "@vue/compiler-core": "3.2.39",
"esbuild": "^0.14.27", "esbuild": "^0.15.9",
"vue": "3.2.39" "vue": "3.2.39"
} }
} }
...@@ -75,7 +75,7 @@ export function uniInjectPlugin(): Plugin { ...@@ -75,7 +75,7 @@ export function uniInjectPlugin(): Plugin {
) )
}, },
transform(code, id) { transform(code, id) {
return injectPlugin.transform!.call(this, code, id) return (injectPlugin.transform as Function).call(this, code, id)
}, },
} }
} }
...@@ -30,7 +30,7 @@ const BLACKLIST = [ ...@@ -30,7 +30,7 @@ const BLACKLIST = [
] ]
export function genApiJson(code: string) { export function genApiJson(code: string) {
const apiNames = [] const apiNames: string[] = []
simple( simple(
parse(code, { parse(code, {
sourceType: 'module', sourceType: 'module',
...@@ -50,7 +50,7 @@ export function genApiJson(code: string) { ...@@ -50,7 +50,7 @@ export function genApiJson(code: string) {
) )
const apiJsonPath = path.resolve(__dirname, '../uni-h5-vite/lib/api.json') const apiJsonPath = path.resolve(__dirname, '../uni-h5-vite/lib/api.json')
const oldApiJson = fs.readFileSync(apiJsonPath, 'utf8').replace(/\r\n/g, '\n') const oldApiJson = fs.readFileSync(apiJsonPath, 'utf8').replace(/\r\n/g, '\n')
const newApiJson = JSON.stringify(apiNames, null, 2) const newApiJson = JSON.stringify(apiNames.sort(), null, 2)
if (oldApiJson !== newApiJson) { if (oldApiJson !== newApiJson) {
fs.writeFileSync( fs.writeFileSync(
path.resolve(__dirname, '../uni-h5-vite/lib/api.new.json'), path.resolve(__dirname, '../uni-h5-vite/lib/api.new.json'),
......
此差异已折叠。
此差异已折叠。
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
"@amap/amap-jsapi-types": "^0.0.8", "@amap/amap-jsapi-types": "^0.0.8",
"acorn-loose": "^8.2.1", "acorn-loose": "^8.2.1",
"acorn-walk": "^8.2.0", "acorn-walk": "^8.2.0",
"estree-walker": "^2.0.2",
"vue": "3.2.39" "vue": "3.2.39"
} }
} }
...@@ -116,6 +116,7 @@ export default defineConfig({ ...@@ -116,6 +116,7 @@ export default defineConfig({
rollupOptions: { rollupOptions: {
output: { output: {
freeze: false, // uni 对象需要可被修改 freeze: false, // uni 对象需要可被修改
entryFileNames: 'uni-h5.' + FORMAT + '.js',
}, },
external(source) { external(source) {
if ( if (
...@@ -134,7 +135,7 @@ export default defineConfig({ ...@@ -134,7 +135,7 @@ export default defineConfig({
} }
}, },
preserveEntrySignatures: 'strict', preserveEntrySignatures: 'strict',
plugins: rollupPlugins, plugins: rollupPlugins as any,
onwarn: (msg, warn) => { onwarn: (msg, warn) => {
if (!String(msg).includes('external module "vue" but never used')) { if (!String(msg).includes('external module "vue" but never used')) {
warn(msg) warn(msg)
......
import { SLOT_DEFAULT_NAME, EventChannel, invokeArrayFns, ON_LOAD, ON_SHOW, ON_HIDE, ON_UNLOAD, ON_RESIZE, ON_TAB_ITEM_TAP, ON_REACH_BOTTOM, ON_PULL_DOWN_REFRESH, ON_ADD_TO_FAVORITES, MINI_PROGRAM_PAGE_RUNTIME_HOOKS, ON_READY, ON_LAUNCH, ON_ERROR, ON_THEME_CHANGE, ON_PAGE_NOT_FOUND, ON_UNHANDLE_REJECTION, customizeEvent, addLeadingSlash, stringifyQuery, ON_BACK_PRESS } from '@dcloudio/uni-shared'; import { SLOT_DEFAULT_NAME, EventChannel, invokeArrayFns, ON_LOAD, ON_SHOW, ON_HIDE, ON_UNLOAD, ON_RESIZE, ON_TAB_ITEM_TAP, ON_REACH_BOTTOM, ON_PULL_DOWN_REFRESH, ON_ADD_TO_FAVORITES, MINI_PROGRAM_PAGE_RUNTIME_HOOKS, ON_READY, ON_LAUNCH, ON_ERROR, ON_THEME_CHANGE, ON_PAGE_NOT_FOUND, ON_UNHANDLE_REJECTION, customizeEvent, addLeadingSlash, stringifyQuery, ON_BACK_PRESS } from '@dcloudio/uni-shared';
import { hasOwn, isArray, capitalize, isFunction, extend, isPlainObject, isString } from '@vue/shared'; import { isArray, hasOwn, capitalize, isFunction, extend, isPlainObject, isString } from '@vue/shared';
import { ref, findComponentPropsData, toRaw, updateProps, hasQueueJob, invalidateJob, getExposeProxy, EMPTY_OBJ, isRef, setTemplateRef, pruneComponentPropsCache } from 'vue'; import { ref, findComponentPropsData, toRaw, updateProps, hasQueueJob, invalidateJob, getExposeProxy, EMPTY_OBJ, isRef, setTemplateRef, pruneComponentPropsCache } from 'vue';
import { normalizeLocale, LOCALE_EN } from '@dcloudio/uni-i18n'; import { normalizeLocale, LOCALE_EN } from '@dcloudio/uni-i18n';
......
...@@ -78,7 +78,7 @@ export function createBuildOptions( ...@@ -78,7 +78,7 @@ export function createBuildOptions(
right: '))', right: '))',
} }
} }
return renderDynamicImport!.call(this, options) return (renderDynamicImport as Function).call(this, options)
}, },
}, },
], ],
......
...@@ -157,7 +157,7 @@ export function uniMiniProgramPlugin( ...@@ -157,7 +157,7 @@ export function uniMiniProgramPlugin(
}, },
configResolved(config) { configResolved(config) {
resolvedConfig = config resolvedConfig = config
return createConfigResolved(options)!(config) return (createConfigResolved(options) as Function)(config)
}, },
generateBundle() { generateBundle() {
if (template.filter) { if (template.filter) {
......
import fs from 'fs' import fs from 'fs'
import path from 'path' import path from 'path'
import type { Plugin } from 'vite' import type { BuildOptions, Plugin } from 'vite'
import type { RollupOptions } from 'rollup'
import { import {
MP_PLUGIN_JSON_NAME, MP_PLUGIN_JSON_NAME,
parseJson, parseJson,
...@@ -17,7 +16,7 @@ export function uniMiniProgramPluginPlugin({ ...@@ -17,7 +16,7 @@ export function uniMiniProgramPluginPlugin({
style: { extname }, style: { extname },
}: UniMiniProgramPluginOptions): Plugin { }: UniMiniProgramPluginOptions): Plugin {
const entry = initPluginEntry() const entry = initPluginEntry()
const rollupOptions: RollupOptions = {} const rollupOptions: BuildOptions['rollupOptions'] = {}
if (entry) { if (entry) {
rollupOptions.input = extend( rollupOptions.input = extend(
{ {
......
import { OutputAsset, OutputChunk, OutputPluginHooks } from 'rollup' import { OutputAsset, OutputChunk } from 'rollup'
import type { Plugin } from 'vite' import type { Plugin } from 'vite'
import { isMiniProgramPageFile, relativeFile } from '@dcloudio/uni-cli-shared' import { isMiniProgramPageFile, relativeFile } from '@dcloudio/uni-cli-shared'
import { UniMiniProgramPluginOptions } from '../plugin' import { UniMiniProgramPluginOptions } from '../plugin'
...@@ -15,7 +15,7 @@ export function uniSubpackagePlugin({ ...@@ -15,7 +15,7 @@ export function uniSubpackagePlugin({
export function createNonAppGenerateBundle( export function createNonAppGenerateBundle(
extname: string extname: string
): OutputPluginHooks['generateBundle'] { ): Plugin['generateBundle'] {
return function generateBundle(_, bundle) { return function generateBundle(_, bundle) {
;['project.config.json', 'app.json'].forEach((name) => { ;['project.config.json', 'app.json'].forEach((name) => {
delete bundle[name] delete bundle[name]
......
import { isRootHook, getValueByDataPath, ON_ERROR, UniLifecycleHooks, invokeCreateErrorHandler, dynamicSlotName } from '@dcloudio/uni-shared'; import { isRootHook, getValueByDataPath, ON_ERROR, UniLifecycleHooks, invokeCreateErrorHandler, dynamicSlotName } from '@dcloudio/uni-shared';
import { extend, isObject, toRawType, def, hasChanged, isArray, isString, isFunction, isPromise, remove, EMPTY_OBJ, toHandlerKey, camelize, capitalize, hasOwn, hyphenate, isReservedProp, normalizeClass, normalizeStyle, isOn, toTypeString, NOOP, isMap, isIntegerKey, isSet, isPlainObject, makeMap, invokeArrayFns, isBuiltInDirective, NO, isSymbol, toNumber, EMPTY_ARR, isModelListener, toDisplayString } from '@vue/shared'; import { extend, isObject, def, hasChanged, isArray, isString, isFunction, isPromise, remove, EMPTY_OBJ, toHandlerKey, camelize, capitalize, hasOwn, hyphenate, isReservedProp, toRawType, normalizeClass, normalizeStyle, isOn, toTypeString, NOOP, isMap, isIntegerKey, isSet, isPlainObject, makeMap, invokeArrayFns, NO, isSymbol, toNumber, isBuiltInDirective, EMPTY_ARR, isModelListener, toDisplayString } from '@vue/shared';
export { EMPTY_OBJ, camelize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared'; export { EMPTY_OBJ, camelize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
function warn(msg, ...args) { function warn(msg, ...args) {
......
...@@ -19,6 +19,6 @@ ...@@ -19,6 +19,6 @@
"dependencies": { "dependencies": {
"@vue/shared": "3.2.39", "@vue/shared": "3.2.39",
"parse-css-font": "^4.0.0", "parse-css-font": "^4.0.0",
"postcss": "^8.4.13" "postcss": "^8.4.16"
} }
} }
...@@ -7,6 +7,7 @@ import { ...@@ -7,6 +7,7 @@ import {
isUniPushOffline, isUniPushOffline,
resolveBuiltIn, resolveBuiltIn,
} from '@dcloudio/uni-cli-shared' } from '@dcloudio/uni-cli-shared'
import { ConfigEnv, UserConfig } from 'vite'
export default () => [ export default () => [
defineUniMainJsPlugin((opts) => { defineUniMainJsPlugin((opts) => {
...@@ -16,7 +17,7 @@ export default () => [ ...@@ -16,7 +17,7 @@ export default () => [
return { return {
name: 'uni:push', name: 'uni:push',
enforce: 'pre', enforce: 'pre',
config(config, env) { config(config: UserConfig, env: ConfigEnv) {
if (isSsr(env.command, config)) { if (isSsr(env.command, config)) {
return return
} }
...@@ -42,7 +43,7 @@ export default () => [ ...@@ -42,7 +43,7 @@ export default () => [
}, },
} }
}, },
resolveId(id) { resolveId(id: string) {
if (id === '@dcloudio/uni-push') { if (id === '@dcloudio/uni-push') {
return resolveBuiltIn( return resolveBuiltIn(
path.join( path.join(
...@@ -54,7 +55,7 @@ export default () => [ ...@@ -54,7 +55,7 @@ export default () => [
) )
} }
}, },
transform(code, id) { transform(code: string, id: string) {
if (!opts.filter(id)) { if (!opts.filter(id)) {
return return
} }
......
...@@ -10,6 +10,7 @@ import { ...@@ -10,6 +10,7 @@ import {
isSsr, isSsr,
resolveBuiltIn, resolveBuiltIn,
} from '@dcloudio/uni-cli-shared' } from '@dcloudio/uni-cli-shared'
import { ConfigEnv, UserConfig } from 'vite'
const uniStatLog = once((text: string) => { const uniStatLog = once((text: string) => {
console.log() console.log()
console.warn(text) console.warn(text)
...@@ -32,7 +33,7 @@ export default () => [ ...@@ -32,7 +33,7 @@ export default () => [
return { return {
name: 'uni:stat', name: 'uni:stat',
enforce: 'pre', enforce: 'pre',
config(config, env) { config(config: UserConfig, env: ConfigEnv) {
const inputDir = process.env.UNI_INPUT_DIR! const inputDir = process.env.UNI_INPUT_DIR!
const platform = process.env.UNI_PLATFORM! const platform = process.env.UNI_PLATFORM!
const titlesJson = Object.create(null) const titlesJson = Object.create(null)
...@@ -97,10 +98,10 @@ export default () => [ ...@@ -97,10 +98,10 @@ export default () => [
}, },
} }
}, },
resolveId(id) { resolveId(id: string) {
return stats[id] || null return stats[id] || null
}, },
transform(code, id) { transform(code: string, id: string) {
if (isEnable && opts.filter(id)) { if (isEnable && opts.filter(id)) {
return { return {
code: code:
......
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
"@dcloudio/uni-cli-shared": "3.0.0-alpha-3060420220922001", "@dcloudio/uni-cli-shared": "3.0.0-alpha-3060420220922001",
"@dcloudio/uni-shared": "3.0.0-alpha-3060420220922001", "@dcloudio/uni-shared": "3.0.0-alpha-3060420220922001",
"@rollup/pluginutils": "^4.2.0", "@rollup/pluginutils": "^4.2.0",
"@vitejs/plugin-legacy": "^1.8.2", "@vitejs/plugin-legacy": "^2.2.0",
"@vitejs/plugin-vue": "^2.3.3", "@vitejs/plugin-vue": "^3.1.0",
"@vitejs/plugin-vue-jsx": "^1.3.10", "@vitejs/plugin-vue-jsx": "^2.0.1",
"@vue/compiler-core": "3.2.39", "@vue/compiler-core": "3.2.39",
"@vue/compiler-dom": "3.2.39", "@vue/compiler-dom": "3.2.39",
"@vue/compiler-sfc": "3.2.39", "@vue/compiler-sfc": "3.2.39",
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
"fs-extra": "^10.0.0", "fs-extra": "^10.0.0",
"hash-sum": "^2.0.0", "hash-sum": "^2.0.0",
"jsonc-parser": "^3.0.0", "jsonc-parser": "^3.0.0",
"terser": "^5.4.0",
"picocolors": "^1.0.0" "picocolors": "^1.0.0"
}, },
"devDependencies": { "devDependencies": {
...@@ -56,11 +57,11 @@ ...@@ -56,11 +57,11 @@
"@types/sass": "^1.16.0", "@types/sass": "^1.16.0",
"@vue/babel-plugin-jsx": "^1.1.1", "@vue/babel-plugin-jsx": "^1.1.1",
"chokidar": "^3.5.3", "chokidar": "^3.5.3",
"vite": "2.9.14", "vite": "3.1.3",
"vue": "3.2.39" "vue": "3.2.39"
}, },
"peerDependencies": { "peerDependencies": {
"vite": "2.9.14" "vite": "3.1.3"
}, },
"uni-app": { "uni-app": {
"compilerVersion": "3.6.4" "compilerVersion": "3.6.4"
......
...@@ -17,7 +17,9 @@ import { CliOptions } from '.' ...@@ -17,7 +17,9 @@ import { CliOptions } from '.'
import { addConfigFile, cleanOptions } from './utils' import { addConfigFile, cleanOptions } from './utils'
import { RollupWatcher, RollupWatcherEvent } from 'rollup' import { RollupWatcher, RollupWatcherEvent } from 'rollup'
export async function build(options: CliOptions) { export async function build(
options: CliOptions
): Promise<RollupWatcher | void> {
if (options.platform === 'app') { if (options.platform === 'app') {
return buildApp(options) return buildApp(options)
} }
...@@ -25,7 +27,7 @@ export async function build(options: CliOptions) { ...@@ -25,7 +27,7 @@ export async function build(options: CliOptions) {
addConfigFile( addConfigFile(
initBuildOptions(options, cleanOptions(options) as BuildOptions) initBuildOptions(options, cleanOptions(options) as BuildOptions)
) )
) ) as Promise<RollupWatcher | void>
} }
export async function buildSSR(options: CliOptions) { export async function buildSSR(options: CliOptions) {
...@@ -95,7 +97,9 @@ function buildManifestJson() { ...@@ -95,7 +97,9 @@ function buildManifestJson() {
) )
} }
export async function buildApp(options: CliOptions) { export async function buildApp(
options: CliOptions
): Promise<RollupWatcher | void> {
if ((options as BuildOptions).manifest) { if ((options as BuildOptions).manifest) {
return buildManifestJson() return buildManifestJson()
} }
...@@ -130,7 +134,7 @@ export async function buildApp(options: CliOptions) { ...@@ -130,7 +134,7 @@ export async function buildApp(options: CliOptions) {
) )
if (appWatcher) { if (appWatcher) {
appWatcher.setSecondWatcher(nvueBuilder as RollupWatcher) appWatcher.setSecondWatcher(nvueBuilder as RollupWatcher)
return appWatcher return appWatcher as unknown as RollupWatcher
} }
return return
} }
...@@ -159,7 +163,7 @@ export async function buildApp(options: CliOptions) { ...@@ -159,7 +163,7 @@ export async function buildApp(options: CliOptions) {
if (appWatcher) { if (appWatcher) {
appWatcher.setSecondWatcher(nvueBuilder as RollupWatcher) appWatcher.setSecondWatcher(nvueBuilder as RollupWatcher)
return appWatcher return appWatcher as unknown as RollupWatcher
} }
} }
......
import fs from 'fs' import fs from 'fs'
import os from 'os'
import path from 'path' import path from 'path'
import colors from 'picocolors' import colors from 'picocolors'
import { import {
CommonServerOptions,
createLogger, createLogger,
createServer as createViteServer, createServer as createViteServer,
Logger,
ResolvedConfig,
ServerOptions, ServerOptions,
ViteDevServer, ViteDevServer,
printHttpServerUrls,
} from 'vite' } from 'vite'
import express from 'express' import express from 'express'
import { parseManifestJson } from '@dcloudio/uni-cli-shared' import { parseManifestJson } from '@dcloudio/uni-cli-shared'
import { CliOptions } from '.' import { CliOptions } from '.'
import { addConfigFile, cleanOptions, printStartupDuration } from './utils' import { addConfigFile, cleanOptions, printStartupDuration } from './utils'
import { AddressInfo, Server } from 'net'
export async function createServer(options: CliOptions & ServerOptions) { export async function createServer(options: CliOptions & ServerOptions) {
const server = await createViteServer( const server = await createViteServer(
...@@ -145,3 +149,95 @@ export async function createSSRServer( ...@@ -145,3 +149,95 @@ export async function createSSRServer(
const server = app.listen(port, hostname!, onSuccess).on('error', onError) const server = app.listen(port, hostname!, onSuccess).on('error', onError)
}) })
} }
function printHttpServerUrls(server: Server, config: ResolvedConfig): void {
printCommonServerUrls(server, config.server, config)
}
function printCommonServerUrls(
server: Server,
options: CommonServerOptions,
config: ResolvedConfig
): void {
const address = server.address()
const isAddressInfo = (x: any): x is AddressInfo => x?.address
if (isAddressInfo(address)) {
const hostname = resolveHostname(options.host)
const protocol = options.https ? 'https' : 'http'
printServerUrls(
hostname,
protocol,
address.port,
config.base,
config.logger.info
)
}
}
function printServerUrls(
hostname: Hostname,
protocol: string,
port: number,
base: string,
info: Logger['info']
): void {
if (hostname.host === '127.0.0.1') {
const url = `${protocol}://${hostname.name}:${colors.bold(port)}${base}`
info(` > Local: ${colors.cyan(url)}`)
if (hostname.name !== '127.0.0.1') {
info(` > Network: ${colors.dim('use `--host` to expose')}`)
}
} else {
Object.values(os.networkInterfaces())
.flatMap((nInterface) => nInterface ?? [])
.filter(
(detail) =>
detail &&
detail.address &&
// Node < v18
((typeof detail.family === 'string' && detail.family === 'IPv4') ||
// Node >= v18
(typeof detail.family === 'number' && detail.family === 4))
)
.map((detail) => {
const type = detail.address.includes('127.0.0.1')
? 'Local: '
: 'Network: '
const host = detail.address.replace('127.0.0.1', hostname.name)
const url = `${protocol}://${host}:${colors.bold(port)}${base}`
return ` > ${type} ${colors.cyan(url)}`
})
.forEach((msg) => info(msg))
}
}
interface Hostname {
// undefined sets the default behaviour of server.listen
host: string | undefined
// resolve to localhost when possible
name: string
}
function resolveHostname(optionsHost: string | boolean | undefined): Hostname {
let host: string | undefined
if (optionsHost === undefined || optionsHost === false) {
// Use a secure default
host = '127.0.0.1'
} else if (optionsHost === true) {
// If passed --host in the CLI without arguments
host = undefined // undefined typically means 0.0.0.0 or :: (listen on all IPs)
} else {
host = optionsHost
}
// Set host name to localhost when possible, unless the user explicitly asked for '127.0.0.1'
const name =
(optionsHost !== '127.0.0.1' && host === '127.0.0.1') ||
host === '0.0.0.0' ||
host === '::' ||
host === undefined
? 'localhost'
: host
return { host, name }
}
...@@ -15,8 +15,10 @@ import { initOptions } from './options' ...@@ -15,8 +15,10 @@ import { initOptions } from './options'
import { initPlugins } from './plugins' import { initPlugins } from './plugins'
import { customResolver } from '../config/resolve' import { customResolver } from '../config/resolve'
export function createConfigResolved(options: VitePluginUniResolvedOptions) { export function createConfigResolved(
return ((config) => { options: VitePluginUniResolvedOptions
): Plugin['configResolved'] {
return (config) => {
// 如果是混合编译且是 nvue 时,部分逻辑无需执行 // 如果是混合编译且是 nvue 时,部分逻辑无需执行
if (!isInHybridNVue(config)) { if (!isInHybridNVue(config)) {
initEnv(config) initEnv(config)
...@@ -37,7 +39,7 @@ export function createConfigResolved(options: VitePluginUniResolvedOptions) { ...@@ -37,7 +39,7 @@ export function createConfigResolved(options: VitePluginUniResolvedOptions) {
item.customResolver = customResolver item.customResolver = customResolver
} }
} }
}) as Plugin['configResolved'] }
} }
function initCheckUpdate() { function initCheckUpdate() {
......
...@@ -2,7 +2,7 @@ import path from 'path' ...@@ -2,7 +2,7 @@ import path from 'path'
import debug from 'debug' import debug from 'debug'
import type { Plugin, ResolvedConfig, ViteDevServer } from 'vite' import type { Plugin, ResolvedConfig, ViteDevServer } from 'vite'
import type { Options as VueOptions } from '@vitejs/plugin-vue' import type { Options as VueOptions } from '@vitejs/plugin-vue'
import type { Options as ViteLegacyOptions } from '@vitejs/plugin-legacy' import type ViteLegacyPlugin from '@vitejs/plugin-legacy'
import type { VueJSXPluginOptions } from '@vue/babel-plugin-jsx' import type { VueJSXPluginOptions } from '@vue/babel-plugin-jsx'
import vueJsxPlugin from '@vitejs/plugin-vue-jsx' import vueJsxPlugin from '@vitejs/plugin-vue-jsx'
import legacyPlugin from '@vitejs/plugin-legacy' import legacyPlugin from '@vitejs/plugin-legacy'
...@@ -31,6 +31,8 @@ import { ...@@ -31,6 +31,8 @@ import {
} from './vue' } from './vue'
import { initEnv } from './cli/utils' import { initEnv } from './cli/utils'
export type ViteLegacyOptions = Parameters<typeof ViteLegacyPlugin>[0]
const debugUni = debug('uni:plugin') const debugUni = debug('uni:plugin')
const pkg = require(path.resolve(__dirname, '../package.json')) const pkg = require(path.resolve(__dirname, '../package.json'))
......
import { hasOwn, isArray, isPlainObject } from '@vue/shared' import { hasOwn, isArray, isPlainObject } from '@vue/shared'
import type { TemplateCompiler } from '@vue/compiler-sfc' import type {
SFCStyleCompileOptions,
TemplateCompiler,
} from '@vue/compiler-sfc'
import type { Options as VueOptions } from '@vitejs/plugin-vue' import type { Options as VueOptions } from '@vitejs/plugin-vue'
import { import {
EXTNAME_VUE_RE, EXTNAME_VUE_RE,
...@@ -11,7 +14,7 @@ import { ...@@ -11,7 +14,7 @@ import {
normalizePath, normalizePath,
} from '@dcloudio/uni-cli-shared' } from '@dcloudio/uni-cli-shared'
import { VitePluginUniResolvedOptions } from '..' import type { ViteLegacyOptions, VitePluginUniResolvedOptions } from '..'
import { createNVueCompiler } from '../utils' import { createNVueCompiler } from '../utils'
const pluginVuePath = require.resolve('@vitejs/plugin-vue') const pluginVuePath = require.resolve('@vitejs/plugin-vue')
...@@ -48,7 +51,8 @@ export function initPluginVueOptions( ...@@ -48,7 +51,8 @@ export function initPluginVueOptions(
} }
vueOptions.include.push(EXTNAME_VUE_RE) vueOptions.include.push(EXTNAME_VUE_RE)
const styleOptions = vueOptions.style || (vueOptions.style = {}) const styleOptions: Partial<SFCStyleCompileOptions> =
vueOptions.style || (vueOptions.style = {})
if (!styleOptions.postcssPlugins) { if (!styleOptions.postcssPlugins) {
styleOptions.postcssPlugins = [] styleOptions.postcssPlugins = []
} }
...@@ -181,7 +185,7 @@ export function initPluginVueJsxOptions( ...@@ -181,7 +185,7 @@ export function initPluginVueJsxOptions(
export function initPluginViteLegacyOptions( export function initPluginViteLegacyOptions(
options: VitePluginUniResolvedOptions options: VitePluginUniResolvedOptions
) { ): ViteLegacyOptions {
const viteLegacyOptions = const viteLegacyOptions =
options.viteLegacyOptions || (options.viteLegacyOptions = {}) options.viteLegacyOptions || (options.viteLegacyOptions = {})
return viteLegacyOptions return viteLegacyOptions
......
此差异已折叠。
...@@ -25,16 +25,16 @@ const pkgs = { ...@@ -25,16 +25,16 @@ const pkgs = {
next: '9.1.9', next: '9.1.9',
}, },
vite: { vite: {
latest: '2.9.14', latest: '3.1.3',
}, },
'@vitejs/plugin-vue': { '@vitejs/plugin-vue': {
latest: '2.3.3', latest: '3.1.0',
}, },
'@vitejs/plugin-vue-jsx': { '@vitejs/plugin-vue-jsx': {
latest: '1.3.10', latest: '2.0.1',
}, },
'@vitejs/plugin-legacy': { '@vitejs/plugin-legacy': {
latest: '1.8.2', latest: '2.2.0',
}, },
'@dcloudio/types': { '@dcloudio/types': {
next: '3.0.16', next: '3.0.16',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册