@weapp-vite/web 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.mjs +1 -2
- package/dist/compiler/wxml/attributes.mjs +12 -4
- package/dist/compiler/wxml/attributes.mjs.map +1 -1
- package/dist/compiler/wxml/compile.mjs +33 -39
- package/dist/compiler/wxml/compile.mjs.map +1 -1
- package/dist/compiler/wxml/dependency.mjs +10 -3
- package/dist/compiler/wxml/dependency.mjs.map +1 -1
- package/dist/compiler/wxml/interpolation.mjs +13 -3
- package/dist/compiler/wxml/interpolation.mjs.map +1 -1
- package/dist/compiler/wxml/nativeTags.mjs +60 -0
- package/dist/compiler/wxml/nativeTags.mjs.map +1 -0
- package/dist/compiler/wxml/navigation.mjs +1 -2
- package/dist/compiler/wxml/parser.mjs +1 -2
- package/dist/compiler/wxml/prepare.mjs +42 -0
- package/dist/compiler/wxml/prepare.mjs.map +1 -0
- package/dist/compiler/wxml/renderer.mjs +1 -2
- package/dist/compiler/wxml/specialNodes.mjs +1 -2
- package/dist/compiler/wxml/types.d.mts +0 -2
- package/dist/compiler/wxml/unknownTags.mjs +33 -0
- package/dist/compiler/wxml/unknownTags.mjs.map +1 -0
- package/dist/compiler/wxs.mjs +1 -2
- package/dist/css/wxss.d.mts +2 -19
- package/dist/css/wxss.mjs +5 -12
- package/dist/css/wxss.mjs.map +1 -1
- package/dist/index.d.mts +8 -3
- package/dist/index.mjs +8 -5
- package/dist/plugin/assets.d.mts +1 -2
- package/dist/plugin/assets.mjs +1 -2
- package/dist/plugin/constants.mjs +5 -4
- package/dist/plugin/constants.mjs.map +1 -1
- package/dist/plugin/dependencyScan.mjs +1 -2
- package/dist/plugin/entry.mjs +6 -4
- package/dist/plugin/entry.mjs.map +1 -1
- package/dist/plugin/files.mjs +1 -2
- package/dist/plugin/hostTypes.d.mts +1 -2
- package/dist/plugin/index.d.mts +0 -2
- package/dist/plugin/index.mjs +29 -24
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/plugin/layout.mjs +1 -2
- package/dist/plugin/navigation.mjs +1 -2
- package/dist/plugin/packageResolution.mjs +1 -2
- package/dist/plugin/path.mjs +1 -2
- package/dist/plugin/register.mjs +1 -2
- package/dist/plugin/scan.mjs +1 -2
- package/dist/plugin/scanConfig.mjs +1 -2
- package/dist/plugin/scanSfc.mjs +1 -2
- package/dist/plugin/sfcHmr.mjs +28 -10
- package/dist/plugin/sfcHmr.mjs.map +1 -1
- package/dist/plugin/state.mjs +1 -2
- package/dist/plugin/styleModule.mjs +1 -2
- package/dist/plugin/types.d.mts +2 -3
- package/dist/plugin/vueSfc.mjs +1 -2
- package/dist/runtime/appShell/container.mjs +1 -2
- package/dist/runtime/appShell/tabBar/index.mjs +1 -2
- package/dist/runtime/appShell/tabBar/style.mjs +1 -2
- package/dist/runtime/appStyle.mjs +1 -2
- package/dist/runtime/button/helpers.mjs +1 -2
- package/dist/runtime/button/index.d.mts +0 -2
- package/dist/runtime/button/index.mjs +1 -2
- package/dist/runtime/button/style.mjs +1 -2
- package/dist/runtime/component/behavior.mjs +1 -2
- package/dist/runtime/component/constants.mjs +1 -2
- package/dist/runtime/component/dom.mjs +1 -2
- package/dist/runtime/component/element.mjs +9 -2
- package/dist/runtime/component/element.mjs.map +1 -1
- package/dist/runtime/component/events.mjs +4 -4
- package/dist/runtime/component/events.mjs.map +1 -1
- package/dist/runtime/component/index.d.mts +0 -2
- package/dist/runtime/component/index.mjs +1 -2
- package/dist/runtime/component/observers.mjs +1 -2
- package/dist/runtime/component/publicInstance.mjs +1 -2
- package/dist/runtime/component/relations.mjs +1 -2
- package/dist/runtime/component/slots.mjs +1 -2
- package/dist/runtime/component/state.mjs +1 -2
- package/dist/runtime/component/types.d.mts +0 -2
- package/dist/runtime/component/utils.mjs +1 -2
- package/dist/runtime/component/virtualHost.mjs +1 -2
- package/dist/runtime/componentEvents.mjs +1 -2
- package/dist/runtime/dataset.mjs +49 -0
- package/dist/runtime/dataset.mjs.map +1 -0
- package/dist/runtime/datasetBinding.d.mts +13 -0
- package/dist/runtime/datasetBinding.mjs +40 -0
- package/dist/runtime/datasetBinding.mjs.map +1 -0
- package/dist/runtime/eventBinding.d.mts +1 -2
- package/dist/runtime/eventBinding.mjs +1 -2
- package/dist/runtime/execution.d.mts +0 -2
- package/dist/runtime/execution.mjs +1 -2
- package/dist/runtime/host/index.d.mts +0 -2
- package/dist/runtime/host/index.mjs +1 -2
- package/dist/runtime/host/types.d.mts +0 -2
- package/dist/runtime/hostGlobals.d.mts +1 -2
- package/dist/runtime/hostGlobals.mjs +1 -2
- package/dist/runtime/index.d.mts +8 -3
- package/dist/runtime/index.mjs +9 -7
- package/dist/runtime/index.mjs.map +1 -1
- package/dist/runtime/inlineStyle.d.mts +5 -0
- package/dist/runtime/inlineStyle.mjs +21 -0
- package/dist/runtime/inlineStyle.mjs.map +1 -0
- package/dist/runtime/inputHandlerResult.mjs +1 -2
- package/dist/runtime/legacyTemplate/dataset.mjs +53 -0
- package/dist/runtime/legacyTemplate/dataset.mjs.map +1 -0
- package/dist/runtime/legacyTemplate/dom.mjs +20 -5
- package/dist/runtime/legacyTemplate/dom.mjs.map +1 -1
- package/dist/runtime/legacyTemplate/expression.mjs +1 -2
- package/dist/runtime/legacyTemplate/index.d.mts +0 -2
- package/dist/runtime/legacyTemplate/index.mjs +23 -16
- package/dist/runtime/legacyTemplate/index.mjs.map +1 -1
- package/dist/runtime/legacyTemplate/types.d.mts +0 -2
- package/dist/runtime/nativeComponents/canvas/index.mjs +1 -2
- package/dist/runtime/nativeComponents/checkbox.mjs +1 -2
- package/dist/runtime/nativeComponents/cover/index.mjs +1 -2
- package/dist/runtime/nativeComponents/form.d.mts +0 -2
- package/dist/runtime/nativeComponents/form.mjs +1 -2
- package/dist/runtime/nativeComponents/formControl.mjs +1 -2
- package/dist/runtime/nativeComponents/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/icon/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/icon/index.mjs +1 -2
- package/dist/runtime/nativeComponents/icon/style.mjs +1 -2
- package/dist/runtime/nativeComponents/image.d.mts +0 -2
- package/dist/runtime/nativeComponents/image.mjs +1 -2
- package/dist/runtime/nativeComponents/index.d.mts +1 -3
- package/dist/runtime/nativeComponents/index.mjs +3 -4
- package/dist/runtime/nativeComponents/index.mjs.map +1 -1
- package/dist/runtime/nativeComponents/input.d.mts +0 -2
- package/dist/runtime/nativeComponents/input.mjs +1 -2
- package/dist/runtime/nativeComponents/label.mjs +1 -2
- package/dist/runtime/nativeComponents/mediaRegistry.mjs +1 -2
- package/dist/runtime/nativeComponents/movable/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/movable/index.mjs +1 -2
- package/dist/runtime/nativeComponents/navigator.mjs +1 -2
- package/dist/runtime/nativeComponents/picker/editors.mjs +1 -2
- package/dist/runtime/nativeComponents/picker/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/picker/index.mjs +1 -2
- package/dist/runtime/nativeComponents/picker/style.mjs +1 -2
- package/dist/runtime/nativeComponents/pickerView/column.mjs +1 -2
- package/dist/runtime/nativeComponents/pickerView/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/pickerView/index.mjs +1 -2
- package/dist/runtime/nativeComponents/pickerView/style.mjs +1 -2
- package/dist/runtime/nativeComponents/primitives.mjs +1 -2
- package/dist/runtime/nativeComponents/progress/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/progress/index.mjs +1 -2
- package/dist/runtime/nativeComponents/progress/style.mjs +1 -2
- package/dist/runtime/nativeComponents/radio.mjs +1 -2
- package/dist/runtime/nativeComponents/richText/index.mjs +3 -4
- package/dist/runtime/nativeComponents/richText/index.mjs.map +1 -1
- package/dist/runtime/nativeComponents/scrollView/boundaries.mjs +62 -0
- package/dist/runtime/nativeComponents/scrollView/boundaries.mjs.map +1 -0
- package/dist/runtime/nativeComponents/{scrollView.d.mts → scrollView/helpers.d.mts} +4 -5
- package/dist/runtime/nativeComponents/scrollView/helpers.mjs +14 -0
- package/dist/runtime/nativeComponents/scrollView/helpers.mjs.map +1 -0
- package/dist/runtime/nativeComponents/scrollView/index.mjs +193 -0
- package/dist/runtime/nativeComponents/scrollView/index.mjs.map +1 -0
- package/dist/runtime/nativeComponents/scrollView/position.mjs +43 -0
- package/dist/runtime/nativeComponents/scrollView/position.mjs.map +1 -0
- package/dist/runtime/nativeComponents/slider/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/slider/index.mjs +1 -2
- package/dist/runtime/nativeComponents/slider/style.mjs +1 -2
- package/dist/runtime/nativeComponents/style.mjs +1 -2
- package/dist/runtime/nativeComponents/swiper/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/swiper/index.mjs +1 -2
- package/dist/runtime/nativeComponents/swiper/item.mjs +1 -2
- package/dist/runtime/nativeComponents/swiper/style.mjs +1 -2
- package/dist/runtime/nativeComponents/switch.d.mts +0 -2
- package/dist/runtime/nativeComponents/switch.mjs +1 -2
- package/dist/runtime/nativeComponents/textarea.d.mts +0 -2
- package/dist/runtime/nativeComponents/textarea.mjs +1 -2
- package/dist/runtime/nativeComponents/video/helpers.d.mts +0 -2
- package/dist/runtime/nativeComponents/video/helpers.mjs +1 -2
- package/dist/runtime/nativeComponents/video/index.mjs +1 -2
- package/dist/runtime/nativeComponents/video/style.mjs +1 -2
- package/dist/runtime/navigationBar/index.d.mts +0 -2
- package/dist/runtime/navigationBar/index.mjs +1 -2
- package/dist/runtime/navigationBar/style.mjs +1 -2
- package/dist/runtime/pageLayout.d.mts +1 -2
- package/dist/runtime/pageLayout.mjs +1 -2
- package/dist/runtime/polyfill/ad.mjs +1 -2
- package/dist/runtime/polyfill/animation.mjs +1 -2
- package/dist/runtime/polyfill/appState.mjs +1 -2
- package/dist/runtime/polyfill/async.d.mts +0 -2
- package/dist/runtime/polyfill/async.mjs +1 -2
- package/dist/runtime/polyfill/auth.mjs +1 -2
- package/dist/runtime/polyfill/authApi.mjs +1 -2
- package/dist/runtime/polyfill/background.mjs +1 -2
- package/dist/runtime/polyfill/canvasContext.mjs +1 -2
- package/dist/runtime/polyfill/capability.mjs +1 -2
- package/dist/runtime/polyfill/cloud.mjs +1 -2
- package/dist/runtime/polyfill/device.mjs +1 -2
- package/dist/runtime/polyfill/deviceApi.mjs +1 -2
- package/dist/runtime/polyfill/deviceAuthSystemApi.d.mts +0 -2
- package/dist/runtime/polyfill/deviceAuthSystemApi.mjs +1 -2
- package/dist/runtime/polyfill/eventBus.mjs +1 -2
- package/dist/runtime/polyfill/filePicker.mjs +1 -2
- package/dist/runtime/polyfill/fileSystemManager.mjs +1 -2
- package/dist/runtime/polyfill/files.mjs +1 -2
- package/dist/runtime/polyfill/font.mjs +1 -2
- package/dist/runtime/polyfill/index.d.mts +4 -4
- package/dist/runtime/polyfill/index.mjs +12 -5
- package/dist/runtime/polyfill/index.mjs.map +1 -1
- package/dist/runtime/polyfill/interaction.mjs +1 -2
- package/dist/runtime/polyfill/interactionApi.mjs +1 -2
- package/dist/runtime/polyfill/intersectionObserver.mjs +4 -4
- package/dist/runtime/polyfill/intersectionObserver.mjs.map +1 -1
- package/dist/runtime/polyfill/lifecycleEvents.d.mts +12 -0
- package/dist/runtime/polyfill/lifecycleEvents.mjs +67 -0
- package/dist/runtime/polyfill/lifecycleEvents.mjs.map +1 -0
- package/dist/runtime/polyfill/locale.mjs +1 -2
- package/dist/runtime/polyfill/location.mjs +1 -2
- package/dist/runtime/polyfill/locationApi.mjs +1 -2
- package/dist/runtime/polyfill/mediaActions.mjs +1 -2
- package/dist/runtime/polyfill/mediaApi/file.mjs +1 -2
- package/dist/runtime/polyfill/mediaApi/info.mjs +1 -2
- package/dist/runtime/polyfill/mediaApi/picker.mjs +1 -2
- package/dist/runtime/polyfill/mediaApi/preview.mjs +1 -2
- package/dist/runtime/polyfill/mediaApi/process.mjs +1 -2
- package/dist/runtime/polyfill/mediaInfo.mjs +1 -2
- package/dist/runtime/polyfill/mediaPicker.mjs +1 -2
- package/dist/runtime/polyfill/mediaProcess.mjs +1 -2
- package/dist/runtime/polyfill/menuApi.mjs +5 -3
- package/dist/runtime/polyfill/menuApi.mjs.map +1 -1
- package/dist/runtime/polyfill/navigationBarRuntime.mjs +1 -2
- package/dist/runtime/polyfill/network/request.mjs +1 -2
- package/dist/runtime/polyfill/network/requestBridge.mjs +1 -2
- package/dist/runtime/polyfill/network/status.mjs +1 -2
- package/dist/runtime/polyfill/platformApi.mjs +1 -2
- package/dist/runtime/polyfill/platformRuntime.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/appLifecycle.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/dom.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/events.d.mts +0 -2
- package/dist/runtime/polyfill/routeRuntime/events.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/history.d.mts +0 -2
- package/dist/runtime/polyfill/routeRuntime/history.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/lifecycle.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/options.d.mts +1 -2
- package/dist/runtime/polyfill/routeRuntime/options.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/result.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/scroll.mjs +37 -6
- package/dist/runtime/polyfill/routeRuntime/scroll.mjs.map +1 -1
- package/dist/runtime/polyfill/routeRuntime/stack.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime/url.mjs +1 -2
- package/dist/runtime/polyfill/routeRuntime.d.mts +2 -2
- package/dist/runtime/polyfill/routeRuntime.mjs +14 -5
- package/dist/runtime/polyfill/routeRuntime.mjs.map +1 -1
- package/dist/runtime/polyfill/runtimeCapabilityApi.mjs +1 -2
- package/dist/runtime/polyfill/runtimeDataApi.d.mts +0 -2
- package/dist/runtime/polyfill/runtimeDataApi.mjs +1 -2
- package/dist/runtime/polyfill/runtimeInfra.mjs +1 -2
- package/dist/runtime/polyfill/runtimeOps.mjs +1 -2
- package/dist/runtime/polyfill/selectorQuery.mjs +3 -3
- package/dist/runtime/polyfill/selectorQuery.mjs.map +1 -1
- package/dist/runtime/polyfill/storage.mjs +1 -2
- package/dist/runtime/polyfill/storageAsync.mjs +1 -2
- package/dist/runtime/polyfill/subscribe.mjs +1 -2
- package/dist/runtime/polyfill/system.mjs +1 -2
- package/dist/runtime/polyfill/systemApi.mjs +1 -2
- package/dist/runtime/polyfill/types/base.d.mts +0 -2
- package/dist/runtime/polyfill/types/common.d.mts +0 -2
- package/dist/runtime/polyfill/types/lifecycle.d.mts +12 -0
- package/dist/runtime/polyfill/types/locationRuntime.d.mts +0 -2
- package/dist/runtime/polyfill/types/mediaAuth.d.mts +0 -2
- package/dist/runtime/polyfill/types/platformRuntime.d.mts +0 -2
- package/dist/runtime/polyfill/types/systemAuth.d.mts +0 -2
- package/dist/runtime/polyfill/types/tabBarRuntime.d.mts +0 -2
- package/dist/runtime/polyfill/ui.mjs +1 -2
- package/dist/runtime/polyfill/uiFeedback.mjs +19 -5
- package/dist/runtime/polyfill/uiFeedback.mjs.map +1 -1
- package/dist/runtime/polyfill/uiMediaApi.d.mts +8 -2
- package/dist/runtime/polyfill/uiMediaApi.mjs +20 -5
- package/dist/runtime/polyfill/uiMediaApi.mjs.map +1 -1
- package/dist/runtime/polyfill/videoContext.mjs +1 -2
- package/dist/runtime/polyfill/vkSession.mjs +1 -2
- package/dist/runtime/polyfill/windowResize.mjs +1 -2
- package/dist/runtime/polyfill/worker.mjs +1 -2
- package/dist/runtime/polyfill.d.mts +4 -2
- package/dist/runtime/renderContext.d.mts +0 -2
- package/dist/runtime/renderContext.mjs +5 -4
- package/dist/runtime/renderContext.mjs.map +1 -1
- package/dist/runtime/rpx.d.mts +0 -2
- package/dist/runtime/rpx.mjs +6 -6
- package/dist/runtime/rpx.mjs.map +1 -1
- package/dist/runtime/seo/index.d.mts +0 -2
- package/dist/runtime/seo/index.mjs +1 -2
- package/dist/runtime/style.d.mts +0 -2
- package/dist/runtime/style.mjs +1 -2
- package/dist/runtime/template.d.mts +0 -2
- package/dist/runtime/utils/object.mjs +1 -2
- package/dist/runtime/viewport/index.d.mts +0 -2
- package/dist/runtime/viewport/index.mjs +1 -2
- package/dist/runtime/viewport/style.mjs +2 -2
- package/dist/runtime/viewport/style.mjs.map +1 -1
- package/dist/runtime/viewport/types.d.mts +0 -2
- package/dist/runtime/warning.d.mts +0 -2
- package/dist/runtime/warning.mjs +1 -2
- package/dist/runtime/wevu.d.mts +1 -2
- package/dist/runtime/wevu.mjs +1 -2
- package/dist/shared/nativeComponents.mjs +10 -3
- package/dist/shared/nativeComponents.mjs.map +1 -1
- package/dist/shared/slugify.mjs +1 -2
- package/dist/shared/styleUnits/options.d.mts +24 -0
- package/dist/shared/styleUnits/options.mjs +13 -0
- package/dist/shared/styleUnits/options.mjs.map +1 -0
- package/dist/shared/styleUnits/value.mjs +63 -0
- package/dist/shared/styleUnits/value.mjs.map +1 -0
- package/dist/shared/tabBar.d.mts +0 -2
- package/dist/shared/tabBar.mjs +1 -2
- package/dist/shared/wxml.mjs +1 -2
- package/package.json +15 -13
- package/dist/runtime/nativeComponents/richText/helpers.mjs +0 -230
- package/dist/runtime/nativeComponents/richText/helpers.mjs.map +0 -1
- package/dist/runtime/nativeComponents/scrollView.mjs +0 -88
- package/dist/runtime/nativeComponents/scrollView.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/plugin/index.ts"],"sourcesContent":["import type { WeappWebVitePlugin, WebCssConfig, WebDevServer, WebHmrContext, WebPluginContext, WebResolvedConfig, WebUserConfig } from './hostTypes'\nimport type { ResolveWebAutoImportTag, ResolveWebModuleId, WeappWebPluginOptions, WebResolvedComponent, WebStylePreprocessOptions } from './types'\nimport { readFile } from 'node:fs/promises'\nimport process from 'node:process'\n\nimport { dirname, extname, resolve } from 'pathe'\nimport { isUniAppCompatibilityFile, transformUniAppSource } from 'wevu/compiler'\nimport { compileWxml } from '../compiler/wxml'\nimport { transformWxsToEsm } from '../compiler/wxs'\nimport { createWxssPostcssPlugin, transformWxssToCss } from '../css/wxss'\nimport { createWebAssetMiddleware, emitWebAssets } from './assets'\nimport { AUTO_ROUTES_ID, ENTRY_ID, RESOLVED_AUTO_ROUTES_ID, RUNTIME_ID, SCRIPT_EXTS, SFC_STYLE_QUERY, SFC_TEMPLATE_QUERY, STYLE_EXTS, STYLE_QUERY, TEMPLATE_EXTS, TEMPLATE_QUERY, TRANSFORM_STYLE_EXTS, WEB_COMPONENT_PREFIX, WEB_COMPONENT_QUERY, WXS_EXTS } from './constants'\nimport { collectExternalComponentOptimizeDeps } from './dependencyScan'\nimport { generateAutoRoutesModule, generateEntryModule } from './entry'\nimport { wrapPageTemplate } from './layout'\nimport { createMiniProgramPackageResolver, getAncestorNodeModulesPaths } from './packageResolution'\nimport { cleanUrl, isHtmlEntry, isInsideDir, normalizePath, resolveFileWithExtensionsSync, resolveRuntimePolyfillPath, resolveTemplatePathSync, resolveWxsPathSync, toRelativeImport, toViteFsImport } from './path'\nimport { transformScriptModule } from './register'\nimport { getStableWebComponentId, scanProject } from './scan'\nimport { collectSfcHmrFiles } from './sfcHmr'\nimport { createEmptyScanState } from './state'\nimport { createInlineStyleModule } from './styleModule'\nimport { ensureWebVueSfcResult, generateWebVueSfcStyle, generateWebVueSfcTemplate, resolveWebVueSfcStyleLanguage, transformWebVueSfcScript } from './vueSfc'\n\nconst WEB_RUNTIME_MODULE_IDS = [\n 'lit',\n 'lit/async-directive.js',\n 'lit/directives/repeat.js',\n] as const\n\nconst SCAN_VIRTUAL_MODULE_IDS = [ENTRY_ID, RESOLVED_AUTO_ROUTES_ID] as const\n\nfunction isTemplateFile(id: string) {\n const lower = id.toLowerCase()\n return TEMPLATE_EXTS.some(ext => lower.endsWith(ext))\n}\n\nfunction isWxsFile(id: string) {\n const lower = id.toLowerCase()\n return WXS_EXTS.some(ext => lower.endsWith(ext))\n}\n\nfunction hasWxsQuery(id: string) {\n return id.includes('?wxs') || id.includes('&wxs')\n}\n\nfunction hasQuery(id: string, query: string) {\n return id.includes(`?${query}`) || id.includes(`&${query}`)\n}\n\nfunction isUniAppDependency(id: string, includes: readonly string[]) {\n return includes.some(packageName => id === packageName || id.startsWith(`${packageName}/`))\n}\n\nfunction resolveSfcStyleSourceFilename(id: string) {\n const filename = cleanUrl(id)\n const vueSuffixIndex = filename.lastIndexOf('.vue.')\n return vueSuffixIndex >= 0\n ? filename.slice(0, vueSuffixIndex + '.vue'.length)\n : filename\n}\n\nfunction createWebCssConfig(\n config: WebUserConfig,\n wxssOptions: WeappWebPluginOptions['wxss'],\n warn?: (message: string) => void,\n): WebCssConfig | undefined {\n const postcssConfig = config.css?.postcss\n if (typeof postcssConfig === 'string') {\n warn?.('[@weapp-vite/web] css.postcss 使用配置文件路径时无法注入 WXSS 转换插件。')\n return undefined\n }\n\n const plugins = postcssConfig?.plugins ?? []\n if (plugins.some(plugin => 'postcssPlugin' in plugin && plugin.postcssPlugin === 'weapp-vite-web-wxss')) {\n return undefined\n }\n\n return {\n postcss: {\n ...postcssConfig,\n plugins: [...plugins, createWxssPostcssPlugin(wxssOptions)],\n },\n preprocessorOptions: config.css?.preprocessorOptions,\n }\n}\n\nfunction resolveStylePreprocessOptions(\n options: WebStylePreprocessOptions | undefined,\n root: string,\n): WebStylePreprocessOptions | undefined {\n if (!options) {\n return undefined\n }\n\n const nodeModules = getAncestorNodeModulesPaths(root)\n return Object.fromEntries(Object.entries(options).map(([language, languageOptions]) => {\n if (!['sass', 'scss'].includes(language)) {\n return [language, languageOptions]\n }\n\n const loadPaths = Array.isArray(languageOptions.loadPaths)\n ? languageOptions.loadPaths.filter((value): value is string => typeof value === 'string')\n : []\n return [language, {\n ...languageOptions,\n loadPaths: Array.from(new Set([...loadPaths, ...nodeModules])),\n }]\n }))\n}\n\nexport function weappWebPlugin(options: WeappWebPluginOptions = {}): WeappWebVitePlugin {\n let root = process.cwd()\n let srcRoot = resolve(root, options.srcDir ?? 'src')\n let enableHmr = false\n let devServer: WebDevServer | undefined\n let resolveWebModuleId: ResolveWebModuleId | undefined\n let resolveMiniProgramModuleId: ResolveWebModuleId | undefined\n let resolveWebAutoImportTag: ResolveWebAutoImportTag | undefined\n const webRuntimeModules = new Map<string, string>()\n let stylePreprocessOptions: WebStylePreprocessOptions | undefined\n let componentImportIdMap = new Map<string, string>()\n\n let state = createEmptyScanState()\n let scanQueue: Promise<void> = Promise.resolve()\n const wxssOptions = options.wxss\n const runtimeProvider = options.__runtimeProvider\n const hmrAcceptCode = runtimeProvider\n ? runtimeProvider.hmrAcceptCode\n : 'if (import.meta.hot) { import.meta.hot.accept() }'\n\n const resolveTemplatePath = (raw: string, importer: string) => resolveTemplatePathSync(raw, importer, srcRoot)\n const resolveWxsPath = (raw: string, importer: string) => resolveWxsPathSync(raw, importer, srcRoot)\n const resolveMetaByTemplate = (filename: string) => {\n const normalized = normalizePath(filename)\n for (const meta of state.moduleMeta.values()) {\n if (meta.templatePath && normalizePath(meta.templatePath) === normalized) {\n return meta\n }\n }\n return undefined\n }\n\n const createAutoImportTagResolver = (): ResolveWebAutoImportTag | undefined => {\n const resolvers = options.__autoImportResolvers\n if (!resolvers?.length) {\n return undefined\n }\n return async (tag, importer) => {\n for (const resolver of resolvers) {\n let matched: WebResolvedComponent | void\n if (typeof resolver === 'function') {\n matched = resolver(tag, importer)\n }\n else if (typeof resolver.resolve === 'function') {\n matched = resolver.resolve(tag, importer)\n }\n else {\n const from = resolver.components?.[tag]\n matched = from ? { name: tag, from } : undefined\n }\n if (!matched) {\n continue\n }\n const request = matched.resolvedId ?? matched.from\n const resolvedId = await resolveWebModuleId?.(request, importer)\n return {\n ...matched,\n resolvedId: resolvedId ?? matched.resolvedId,\n sourceType: matched.sourceType ?? (resolvedId?.endsWith('.vue') ? 'wevu-sfc' : 'native'),\n }\n }\n return undefined\n }\n }\n\n const scan = (context: WebPluginContext) => {\n const result = scanQueue.then(async () => {\n const nextState = createEmptyScanState()\n await scanProject({\n srcRoot,\n warn: context.warn?.bind(context),\n state: nextState,\n resolveId: resolveWebModuleId,\n resolveAutoImportTag: resolveWebAutoImportTag,\n resolveAppConfig: options.__resolveAppConfig,\n uniApp: options.__uniApp,\n stylePreprocessOptions,\n })\n const nextComponentImportIdMap = new Map<string, string>()\n for (const component of nextState.scanResult.components) {\n if (component.importId) {\n nextComponentImportIdMap.set(component.importId, component.script)\n }\n }\n const graph = devServer?.moduleGraph\n const files = graph ? new Set<string>() : undefined\n if (files) {\n for (const snapshot of [state, nextState]) {\n for (const file of snapshot.moduleMeta.keys()) {\n files.add(file)\n }\n for (const file of snapshot.templatePathSet) {\n files.add(file)\n }\n for (const [file, result] of snapshot.sfcResults) {\n files.add(`${file}.${resolveWebVueSfcStyleLanguage(result, file)}`)\n }\n }\n }\n // 虚拟模块始终读取最后一次完整快照,不暴露扫描过程中的空映射。\n state = nextState\n componentImportIdMap = nextComponentImportIdMap\n if (graph && files) {\n for (const id of SCAN_VIRTUAL_MODULE_IDS) {\n const module = graph.getModuleById(id)\n if (module) {\n graph.invalidateModule(module)\n }\n }\n // 入口失效不会向下传播;脚本、模板和合成样式同样属于扫描快照。\n for (const file of files) {\n const modules = graph.getModulesByFile(file)\n if (modules) {\n for (const module of modules) {\n graph.invalidateModule(module)\n }\n }\n }\n }\n })\n // 调用方仍接收原始错误;队尾只负责允许下一次文件变更恢复扫描。\n scanQueue = result.catch(() => {})\n return result\n }\n\n const scanChangedFile = async (context: WebPluginContext, file: string) => {\n const clean = cleanUrl(file)\n const normalized = normalizePath(clean)\n if (!isInsideDir(clean, srcRoot) && !state.moduleMeta.has(normalized) && !state.templatePathSet.has(normalized)) {\n return\n }\n if (state.templatePathSet.has(normalized) || clean.endsWith('.json') || isTemplateFile(clean) || isWxsFile(clean) || clean.endsWith('.wxss') || SCRIPT_EXTS.includes(extname(clean))) {\n await scan(context)\n }\n }\n\n return {\n name: '@weapp-vite/web',\n enforce: 'pre',\n config(this: WebPluginContext, config: WebUserConfig) {\n const css = createWebCssConfig(config, wxssOptions, this.warn?.bind(this))\n return css ? { css } : undefined\n },\n async configResolved(this: WebPluginContext, config: WebResolvedConfig) {\n root = config.root\n const { createRequire } = await import('node:module')\n const requireFromWebRuntime = createRequire(import.meta.url)\n const requireFromProject = createRequire(resolve(root, 'package.json'))\n for (const id of WEB_RUNTIME_MODULE_IDS) {\n webRuntimeModules.set(id, requireFromWebRuntime.resolve(id))\n }\n webRuntimeModules.set(RUNTIME_ID, resolveRuntimePolyfillPath())\n resolveMiniProgramModuleId = createMiniProgramPackageResolver(requireFromProject.resolve)\n srcRoot = resolve(root, options.srcDir ?? 'src')\n stylePreprocessOptions = resolveStylePreprocessOptions(config.css?.preprocessorOptions, root)\n enableHmr = config.command === 'serve'\n const resolveViteModuleId = config.createResolver?.()\n resolveWebModuleId = resolveViteModuleId\n ? async (source, importer) => {\n const resolved = await resolveViteModuleId(source, importer)\n return await resolveMiniProgramModuleId?.(resolved ?? source, importer)\n ?? await resolveMiniProgramModuleId?.(source, importer)\n ?? resolved\n }\n : undefined\n resolveWebAutoImportTag = createAutoImportTagResolver()\n await scan(this)\n const componentDependencies = await collectExternalComponentOptimizeDeps(state.scanResult.components)\n const uniAppIncludes = options.__uniApp?.include ?? []\n config.optimizeDeps ??= {}\n config.optimizeDeps.exclude = Array.from(new Set([\n ...(config.optimizeDeps.exclude ?? []),\n ...uniAppIncludes,\n ]))\n config.optimizeDeps.include = Array.from(new Set([\n ...(config.optimizeDeps.include ?? []),\n ...componentDependencies,\n ])).filter(dependency => !isUniAppDependency(dependency, uniAppIncludes))\n },\n configureServer(server: WebDevServer) {\n devServer = server\n server.middlewares.use(createWebAssetMiddleware(srcRoot))\n },\n async buildStart(this: WebPluginContext) {\n if (!resolveWebModuleId && this.resolve) {\n resolveWebModuleId = async (source, importer) => {\n const resolved = await this.resolve?.(source, importer, { skipSelf: true })\n return await resolveMiniProgramModuleId?.(resolved?.id ?? source, importer)\n ?? await resolveMiniProgramModuleId?.(source, importer)\n ?? resolved?.id\n }\n }\n resolveWebAutoImportTag = createAutoImportTagResolver()\n await scan(this)\n if (!enableHmr) {\n await emitWebAssets(this, srcRoot)\n }\n },\n resolveId(id: string, importer?: string) {\n const runtimeModule = webRuntimeModules.get(id)\n if (runtimeModule) {\n return runtimeModule\n }\n if (id === '/@weapp-vite/web/entry' || id === '@weapp-vite/web/entry') {\n return ENTRY_ID\n }\n if (id === AUTO_ROUTES_ID) {\n return RESOLVED_AUTO_ROUTES_ID\n }\n if (id.startsWith(WEB_COMPONENT_PREFIX)) {\n const request = decodeURIComponent(id.slice(WEB_COMPONENT_PREFIX.length))\n const resolvedId = componentImportIdMap.get(request)\n return resolvedId ? `${cleanUrl(resolvedId)}?${WEB_COMPONENT_QUERY}` : null\n }\n if (id.startsWith('.') && importer && cleanUrl(importer).endsWith('.vue') && !extname(id)) {\n const resolvedScript = resolveFileWithExtensionsSync(resolve(dirname(cleanUrl(importer)), id), SCRIPT_EXTS)\n if (resolvedScript?.endsWith('.vue')) {\n return resolvedScript\n }\n }\n if (hasQuery(id, SFC_STYLE_QUERY)) {\n const queryIndex = id.indexOf('?')\n const pathname = queryIndex >= 0 ? id.slice(0, queryIndex) : id\n const query = queryIndex >= 0 ? id.slice(queryIndex) : ''\n if (pathname.startsWith('.') && importer) {\n return `${resolve(dirname(cleanUrl(importer)), pathname)}${query}`\n }\n return id\n }\n return resolveMiniProgramModuleId?.(id, importer).then(resolved => resolved ?? null) ?? null\n },\n async load(this: WebPluginContext, id: string) {\n if (id === ENTRY_ID) {\n return generateEntryModule(state.scanResult, root, wxssOptions, options)\n }\n if (id === RESOLVED_AUTO_ROUTES_ID) {\n return generateAutoRoutesModule(state.scanResult)\n }\n if (hasQuery(id, TEMPLATE_QUERY)) {\n const filename = cleanUrl(id)\n let source = await readFile(filename, 'utf8')\n const pageMeta = resolveMetaByTemplate(filename)\n if (pageMeta?.kind === 'page' && state.scanResult.layouts.length) {\n source = wrapPageTemplate(source, state.scanResult.layouts)\n }\n const navigationConfig = state.pageNavigationMap.get(normalizePath(filename))\n const componentTags = state.templateComponentMap.get(normalizePath(filename))\n const compiled = compileWxml({\n id: filename,\n source,\n resolveTemplatePath,\n resolveWxsPath,\n navigationBar: navigationConfig ? { config: navigationConfig } : undefined,\n componentTags,\n })\n for (const dependency of compiled.dependencies) {\n this.addWatchFile?.(dependency)\n }\n for (const warning of compiled.warnings ?? []) {\n this.warn?.(warning)\n }\n return compiled.code\n }\n if (hasWxsQuery(id)) {\n const filename = cleanUrl(id)\n const source = await readFile(filename, 'utf8')\n const compiled = transformWxsToEsm(source, filename, {\n resolvePath: resolveWxsPath,\n toImportPath: (resolved, importer) => normalizePath(toRelativeImport(importer, resolved)),\n })\n for (const dependency of compiled.dependencies) {\n this.addWatchFile?.(dependency)\n }\n for (const warning of compiled.warnings ?? []) {\n this.warn?.(warning)\n }\n return compiled.code\n }\n if (hasQuery(id, STYLE_QUERY)) {\n const source = await readFile(cleanUrl(id), 'utf8')\n const { css } = transformWxssToCss(source, wxssOptions)\n return createInlineStyleModule(css)\n }\n if (id.includes(`?${SFC_TEMPLATE_QUERY}`) || id.includes(`&${SFC_TEMPLATE_QUERY}`)) {\n const filename = cleanUrl(id)\n const meta = state.moduleMeta.get(normalizePath(filename))\n if (!meta) {\n return null\n }\n const result = await ensureWebVueSfcResult({\n filename,\n meta,\n srcRoot,\n state,\n resolveId: resolveWebModuleId,\n resolveAutoImportTag: resolveWebAutoImportTag,\n uniApp: options.__uniApp,\n stylePreprocessOptions,\n })\n const compiled = generateWebVueSfcTemplate(result, meta, filename, srcRoot)\n for (const dependency of compiled.dependencies) {\n this.addWatchFile?.(dependency)\n }\n for (const warning of compiled.warnings ?? []) {\n this.warn?.(warning)\n }\n return compiled.code\n }\n if (id.includes(`?${SFC_STYLE_QUERY}`) || id.includes(`&${SFC_STYLE_QUERY}`)) {\n const filename = resolveSfcStyleSourceFilename(id)\n const meta = state.moduleMeta.get(normalizePath(filename))\n if (!meta) {\n return null\n }\n const result = await ensureWebVueSfcResult({\n filename,\n meta,\n srcRoot,\n state,\n resolveId: resolveWebModuleId,\n resolveAutoImportTag: resolveWebAutoImportTag,\n uniApp: options.__uniApp,\n stylePreprocessOptions,\n })\n this.addWatchFile?.(filename)\n for (const dependency of result.meta?.sfcSrcDeps ?? []) {\n this.addWatchFile?.(dependency)\n }\n return generateWebVueSfcStyle(result)\n }\n return null\n },\n watchChange: {\n order: 'post',\n sequential: true,\n async handler(this: WebPluginContext, id, change) {\n // Vite 的 handleHotUpdate 不处理增删;必须在结构性 HMR 前发布完整入口。\n if (enableHmr && change.event !== 'update') {\n await scanChangedFile(this, id)\n }\n },\n },\n async handleHotUpdate<Module extends object>(this: WebPluginContext, ctx: WebHmrContext<Module>) {\n const graph = devServer?.moduleGraph\n const affected = new Set(ctx.modules)\n if (graph) {\n for (const file of collectSfcHmrFiles(state, cleanUrl(ctx.file))) {\n // 在扫描替换入口快照前保留旧节点,覆盖外部块删除及样式后缀变更。\n for (const module of graph.getModulesByFile(file) ?? []) {\n // 图与本次 HMR 上下文来自同一 Vite server,保留宿主模块节点的具体类型。\n affected.add(module as Module)\n }\n }\n }\n await scanChangedFile(this, ctx.file)\n return ctx.modules || affected.size ? [...affected] : undefined\n },\n async transform(this: WebPluginContext, code: string, id: string) {\n const clean = cleanUrl(id)\n let uniAppTransformed = false\n\n if (\n options.__uniApp\n && isUniAppCompatibilityFile(clean, srcRoot, options.__uniApp.include)\n && !clean.endsWith('.vue')\n ) {\n const transformed = transformUniAppSource(code, { filename: clean, target: 'h5' })\n if (transformed.changed) {\n code = transformed.code\n uniAppTransformed = true\n }\n }\n\n if (\n hasQuery(id, TEMPLATE_QUERY)\n || hasWxsQuery(id)\n || hasQuery(id, STYLE_QUERY)\n || hasQuery(id, SFC_TEMPLATE_QUERY)\n || hasQuery(id, SFC_STYLE_QUERY)\n ) {\n return null\n }\n\n if (clean.endsWith('.vue')) {\n const normalized = normalizePath(clean)\n const meta = state.moduleMeta.get(normalized) ?? {\n kind: 'component' as const,\n id: getStableWebComponentId(clean, srcRoot),\n scriptPath: clean,\n sourceType: 'vue-sfc' as const,\n }\n state.moduleMeta.set(normalized, meta)\n const result = await ensureWebVueSfcResult({\n filename: clean,\n meta,\n srcRoot,\n state,\n source: code,\n resolveId: resolveWebModuleId,\n resolveAutoImportTag: resolveWebAutoImportTag,\n uniApp: options.__uniApp,\n stylePreprocessOptions,\n })\n return transformWebVueSfcScript({\n code: result.script!,\n filename: clean,\n meta,\n runtimeModuleId: runtimeProvider?.moduleId ?? toViteFsImport(resolveRuntimePolyfillPath()),\n styleLanguage: resolveWebVueSfcStyleLanguage(result, clean),\n enableHmr,\n hmrAcceptCode,\n })\n }\n\n if (isTemplateFile(clean)) {\n if (isHtmlEntry(clean, root)) {\n return null\n }\n const normalizedId = normalizePath(clean)\n if (state.templatePathSet.size > 0) {\n if (!isInsideDir(clean, srcRoot)) {\n return null\n }\n if (!state.templatePathSet.has(normalizedId)) {\n return null\n }\n }\n let templateSource = code\n const pageMeta = resolveMetaByTemplate(clean)\n if (pageMeta?.kind === 'page' && state.scanResult.layouts.length) {\n templateSource = wrapPageTemplate(code, state.scanResult.layouts)\n }\n const navigationConfig = state.pageNavigationMap.get(normalizedId)\n const componentTags = state.templateComponentMap.get(normalizedId)\n const { code: compiled, dependencies, warnings } = compileWxml({\n id: clean,\n source: templateSource,\n resolveTemplatePath,\n resolveWxsPath,\n navigationBar: navigationConfig ? { config: navigationConfig } : undefined,\n componentTags,\n })\n const addWatchFile = this.addWatchFile\n if (dependencies.length > 0 && addWatchFile) {\n for (const dep of dependencies) {\n addWatchFile.call(this, dep)\n }\n }\n const warn = this.warn\n if (warnings?.length && warn) {\n for (const warning of warnings) {\n warn.call(this, warning)\n }\n }\n return { code: compiled, map: null }\n }\n\n if (isWxsFile(clean) || hasWxsQuery(id)) {\n const { code: compiled, dependencies, warnings } = transformWxsToEsm(code, clean, {\n resolvePath: resolveWxsPath,\n toImportPath: (resolved, importer) => normalizePath(toRelativeImport(importer, resolved)),\n })\n const addWatchFile = this.addWatchFile\n if (dependencies.length > 0 && addWatchFile) {\n for (const dep of dependencies) {\n addWatchFile.call(this, dep)\n }\n }\n const warn = this.warn\n if (warnings?.length && warn) {\n for (const warning of warnings) {\n warn.call(this, warning)\n }\n }\n return { code: compiled, map: null }\n }\n\n if (TRANSFORM_STYLE_EXTS.some(ext => clean.endsWith(ext))) {\n const { css } = transformWxssToCss(code, wxssOptions)\n return {\n code: createInlineStyleModule(css),\n map: null,\n }\n }\n\n if (STYLE_EXTS.some(ext => clean.endsWith(ext)) && !clean.endsWith('.wxss')) {\n const { css } = transformWxssToCss(code, wxssOptions)\n return { code: css, map: null }\n }\n\n if (!SCRIPT_EXTS.some(ext => clean.endsWith(ext))) {\n return uniAppTransformed ? { code, map: null } : null\n }\n if (clean.includes('node_modules') && !hasQuery(id, WEB_COMPONENT_QUERY)) {\n return options.__uniApp && isUniAppCompatibilityFile(clean, srcRoot, options.__uniApp.include)\n ? { code, map: null }\n : null\n }\n\n const meta = state.moduleMeta.get(normalizePath(clean))\n if (!meta) {\n return null\n }\n\n return transformScriptModule({\n code,\n cleanId: clean,\n meta,\n enableHmr,\n runtimeModuleId: runtimeProvider?.moduleId,\n hmrAcceptCode,\n })\n },\n }\n}\n\nexport type { WeappWebPluginOptions } from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAM,yBAAyB;CAC7B;CACA;CACA;AACF;AAEA,MAAM,0BAA0B,CAAC,UAAU,uBAAuB;AAElE,SAAS,eAAe,IAAY;CAClC,MAAM,QAAQ,GAAG,YAAY;CAC7B,OAAO,cAAc,MAAK,QAAO,MAAM,SAAS,GAAG,CAAC;AACtD;AAEA,SAAS,UAAU,IAAY;CAC7B,MAAM,QAAQ,GAAG,YAAY;CAC7B,OAAO,SAAS,MAAK,QAAO,MAAM,SAAS,GAAG,CAAC;AACjD;AAEA,SAAS,YAAY,IAAY;CAC/B,OAAO,GAAG,SAAS,MAAM,KAAK,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,GAAG,CAAC,GAC9C,OAAO,oBAAoB;IAAE;IAAM,KAAK;GAAK,IAAI;GAEnD,IAAI,MAAM,SAAS,cAAc,KAAK,CAAC,SAAS,yBAAuB,GACrE,OAAO,QAAQ,YAAY,0BAA0B,OAAO,SAAS,QAAQ,SAAS,OAAO,IACzF;IAAE;IAAM,KAAK;GAAK,IAClB;GAGN,MAAM,OAAO,MAAM,WAAW,IAAI,cAAc,KAAK,CAAC;GACtD,IAAI,CAAC,MACH,OAAO;GAGT,OAAO,sBAAsB;IAC3B;IACA,SAAS;IACT;IACA;IACA,iBAAiB,iBAAiB;IAClC;GACF,CAAC;EACH;CACF;AACF"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/plugin/index.ts"],"sourcesContent":["import type { WeappWebVitePlugin, WebCssConfig, WebDevServer, WebHmrContext, WebPluginContext, WebResolvedConfig, WebUserConfig } from './hostTypes'\nimport type { ResolveWebAutoImportTag, ResolveWebModuleId, WeappWebPluginOptions, WebResolvedComponent, WebStylePreprocessOptions } from './types'\nimport { readFile } from 'node:fs/promises'\nimport process from 'node:process'\n\nimport { dirname, extname, resolve } from 'pathe'\nimport { isUniAppCompatibilityFile, transformUniAppSource } from 'wevu/compiler'\nimport { compileWxml } from '../compiler/wxml'\nimport { compileWxmlDependency } from '../compiler/wxml/compile'\nimport { transformWxsToEsm } from '../compiler/wxs'\nimport { createWxssPostcssPlugin, transformWxssToCss } from '../css/wxss'\nimport { createWebAssetMiddleware, emitWebAssets } from './assets'\nimport { AUTO_ROUTES_ID, ENTRY_ID, RESOLVED_AUTO_ROUTES_ID, RUNTIME_ID, SCRIPT_EXTS, SFC_STYLE_QUERY, SFC_TEMPLATE_QUERY, STYLE_EXTS, STYLE_QUERY, TEMPLATE_EXTS, TEMPLATE_QUERY, TRANSFORM_STYLE_EXTS, WEB_COMPONENT_PREFIX, WEB_COMPONENT_QUERY, WXS_EXTS } from './constants'\nimport { collectExternalComponentOptimizeDeps } from './dependencyScan'\nimport { generateAutoRoutesModule, generateEntryModule } from './entry'\nimport { wrapPageTemplate } from './layout'\nimport { createMiniProgramPackageResolver, getAncestorNodeModulesPaths } from './packageResolution'\nimport { cleanUrl, isHtmlEntry, isInsideDir, normalizePath, resolveFileWithExtensionsSync, resolveRuntimePolyfillPath, resolveTemplatePathSync, resolveWxsPathSync, toRelativeImport, toViteFsImport } from './path'\nimport { transformScriptModule } from './register'\nimport { getStableWebComponentId, scanProject } from './scan'\nimport { collectSfcHmrModules } from './sfcHmr'\nimport { createEmptyScanState } from './state'\nimport { createInlineStyleModule } from './styleModule'\nimport { ensureWebVueSfcResult, generateWebVueSfcStyle, generateWebVueSfcTemplate, resolveWebVueSfcStyleLanguage, transformWebVueSfcScript } from './vueSfc'\n\nconst WEB_RUNTIME_MODULE_IDS = [\n 'lit',\n 'lit/async-directive.js',\n 'lit/directives/repeat.js',\n] as const\n\nconst SCAN_VIRTUAL_MODULE_IDS = [ENTRY_ID, RESOLVED_AUTO_ROUTES_ID] as const\n\nfunction isTemplateFile(id: string) {\n const lower = id.toLowerCase()\n return TEMPLATE_EXTS.some(ext => lower.endsWith(ext))\n}\n\nfunction isWxsFile(id: string) {\n const lower = id.toLowerCase()\n return WXS_EXTS.some(ext => lower.endsWith(ext))\n}\n\nfunction hasWxsQuery(id: string) {\n return id.includes('?wxs') || id.includes('&wxs')\n}\n\nfunction hasQuery(id: string, query: string) {\n return id.includes(`?${query}`) || id.includes(`&${query}`)\n}\n\nfunction isUniAppDependency(id: string, includes: readonly string[]) {\n return includes.some(packageName => id === packageName || id.startsWith(`${packageName}/`))\n}\n\nfunction resolveSfcStyleSourceFilename(id: string) {\n const filename = cleanUrl(id)\n const vueSuffixIndex = filename.lastIndexOf('.vue.')\n return vueSuffixIndex >= 0\n ? filename.slice(0, vueSuffixIndex + '.vue'.length)\n : filename\n}\n\nfunction createWebCssConfig(\n config: WebUserConfig,\n wxssOptions: WeappWebPluginOptions['wxss'],\n warn?: (message: string) => void,\n): WebCssConfig | undefined {\n const postcssConfig = config.css?.postcss\n if (typeof postcssConfig === 'string') {\n warn?.('[@weapp-vite/web] css.postcss 使用配置文件路径时无法注入 WXSS 转换插件。')\n return undefined\n }\n\n const plugins = postcssConfig?.plugins ?? []\n if (plugins.some(plugin => 'postcssPlugin' in plugin && plugin.postcssPlugin === 'weapp-vite-web-wxss')) {\n return undefined\n }\n\n return {\n postcss: {\n ...postcssConfig,\n plugins: [...plugins, createWxssPostcssPlugin(wxssOptions)],\n },\n preprocessorOptions: config.css?.preprocessorOptions,\n }\n}\n\nfunction resolveStylePreprocessOptions(\n options: WebStylePreprocessOptions | undefined,\n root: string,\n): WebStylePreprocessOptions | undefined {\n if (!options) {\n return undefined\n }\n\n const nodeModules = getAncestorNodeModulesPaths(root)\n return Object.fromEntries(Object.entries(options).map(([language, languageOptions]) => {\n if (!['sass', 'scss'].includes(language)) {\n return [language, languageOptions]\n }\n\n const loadPaths = Array.isArray(languageOptions.loadPaths)\n ? languageOptions.loadPaths.filter((value): value is string => typeof value === 'string')\n : []\n return [language, {\n ...languageOptions,\n loadPaths: Array.from(new Set([...loadPaths, ...nodeModules])),\n }]\n }))\n}\n\nexport function weappWebPlugin(options: WeappWebPluginOptions = {}): WeappWebVitePlugin {\n let root = process.cwd()\n let srcRoot = resolve(root, options.srcDir ?? 'src')\n let enableHmr = false\n let devServer: WebDevServer | undefined\n let resolveWebModuleId: ResolveWebModuleId | undefined\n let resolveMiniProgramModuleId: ResolveWebModuleId | undefined\n let resolveWebAutoImportTag: ResolveWebAutoImportTag | undefined\n const webRuntimeModules = new Map<string, string>()\n let stylePreprocessOptions: WebStylePreprocessOptions | undefined\n let componentImportIdMap = new Map<string, string>()\n\n let state = createEmptyScanState()\n let scanQueue: Promise<void> = Promise.resolve()\n const wxssOptions = options.wxss\n const runtimeProvider = options.__runtimeProvider\n const hmrAcceptCode = runtimeProvider\n ? runtimeProvider.hmrAcceptCode\n : 'if (import.meta.hot) { import.meta.hot.accept() }'\n\n const resolveTemplatePath = (raw: string, importer: string) => resolveTemplatePathSync(raw, importer, srcRoot)\n const resolveWxsPath = (raw: string, importer: string) => resolveWxsPathSync(raw, importer, srcRoot)\n const resolveMetaByTemplate = (filename: string) => {\n const normalized = normalizePath(filename)\n for (const meta of state.moduleMeta.values()) {\n if (meta.templatePath && normalizePath(meta.templatePath) === normalized) {\n return meta\n }\n }\n return undefined\n }\n\n const createAutoImportTagResolver = (): ResolveWebAutoImportTag | undefined => {\n const resolvers = options.__autoImportResolvers\n if (!resolvers?.length) {\n return undefined\n }\n return async (tag, importer) => {\n for (const resolver of resolvers) {\n let matched: WebResolvedComponent | void\n if (typeof resolver === 'function') {\n matched = resolver(tag, importer)\n }\n else if (typeof resolver.resolve === 'function') {\n matched = resolver.resolve(tag, importer)\n }\n else {\n const from = resolver.components?.[tag]\n matched = from ? { name: tag, from } : undefined\n }\n if (!matched) {\n continue\n }\n const request = matched.resolvedId ?? matched.from\n const resolvedId = await resolveWebModuleId?.(request, importer)\n return {\n ...matched,\n resolvedId: resolvedId ?? matched.resolvedId,\n sourceType: matched.sourceType ?? (resolvedId?.endsWith('.vue') ? 'wevu-sfc' : 'native'),\n }\n }\n return undefined\n }\n }\n\n const scan = (context: WebPluginContext) => {\n const graph = devServer?.moduleGraph\n // 先撤销旧拓扑响应,避免扫描期间的浏览器重验证通过缓存跳过 load。\n for (const id of SCAN_VIRTUAL_MODULE_IDS) {\n const module = graph?.getModuleById(id)\n if (module) {\n graph?.invalidateModule(module)\n }\n }\n const result = scanQueue.then(async () => {\n const previousState = state\n const nextState = createEmptyScanState()\n await scanProject({\n srcRoot,\n warn: context.warn?.bind(context),\n state: nextState,\n resolveId: resolveWebModuleId,\n resolveAutoImportTag: resolveWebAutoImportTag,\n resolveAppConfig: options.__resolveAppConfig,\n uniApp: options.__uniApp,\n stylePreprocessOptions,\n })\n const nextComponentImportIdMap = new Map<string, string>()\n for (const component of nextState.scanResult.components) {\n if (component.importId) {\n nextComponentImportIdMap.set(component.importId, component.script)\n }\n }\n const files = graph ? new Set<string>() : undefined\n if (files) {\n for (const snapshot of [state, nextState]) {\n for (const file of snapshot.moduleMeta.keys()) {\n files.add(file)\n }\n for (const file of snapshot.templatePathSet) {\n files.add(file)\n }\n for (const [file, result] of snapshot.sfcResults) {\n files.add(`${file}.${resolveWebVueSfcStyleLanguage(result, file)}`)\n }\n }\n }\n // 源模块始终读取最后一次完整快照,不暴露扫描过程中的空映射。\n state = nextState\n componentImportIdMap = nextComponentImportIdMap\n if (graph && files) {\n // 入口失效不会向下传播;脚本、模板和合成样式同样属于扫描快照。\n for (const file of files) {\n const modules = graph.getModulesByFile(file)\n if (modules) {\n for (const module of modules) {\n graph.invalidateModule(module)\n }\n }\n }\n }\n return [previousState, nextState] as const\n })\n // 调用方仍接收原始错误;队尾只负责允许下一次文件变更恢复扫描。\n scanQueue = result.then(() => {}, () => {})\n return result\n }\n\n const scanChangedFile = async (context: WebPluginContext, file: string) => {\n const clean = cleanUrl(file)\n const normalized = normalizePath(clean)\n if (!isInsideDir(clean, srcRoot) && !state.moduleMeta.has(normalized) && !state.templatePathSet.has(normalized)) {\n return\n }\n if (state.templatePathSet.has(normalized) || clean.endsWith('.json') || isTemplateFile(clean) || isWxsFile(clean) || clean.endsWith('.wxss') || SCRIPT_EXTS.includes(extname(clean))) {\n return scan(context)\n }\n }\n\n return {\n name: '@weapp-vite/web',\n enforce: 'pre',\n config(this: WebPluginContext, config: WebUserConfig) {\n const css = createWebCssConfig(config, wxssOptions, this.warn?.bind(this))\n return css ? { css } : undefined\n },\n async configResolved(this: WebPluginContext, config: WebResolvedConfig) {\n root = config.root\n const { createRequire } = await import('node:module')\n const requireFromWebRuntime = createRequire(import.meta.url)\n const requireFromProject = createRequire(resolve(root, 'package.json'))\n for (const id of WEB_RUNTIME_MODULE_IDS) {\n webRuntimeModules.set(id, requireFromWebRuntime.resolve(id))\n }\n webRuntimeModules.set(RUNTIME_ID, resolveRuntimePolyfillPath())\n resolveMiniProgramModuleId = createMiniProgramPackageResolver(requireFromProject.resolve)\n srcRoot = resolve(root, options.srcDir ?? 'src')\n stylePreprocessOptions = resolveStylePreprocessOptions(config.css?.preprocessorOptions, root)\n enableHmr = config.command === 'serve'\n const resolveViteModuleId = config.createResolver?.()\n resolveWebModuleId = resolveViteModuleId\n ? async (source, importer) => {\n const resolved = await resolveViteModuleId(source, importer)\n return await resolveMiniProgramModuleId?.(resolved ?? source, importer)\n ?? await resolveMiniProgramModuleId?.(source, importer)\n ?? resolved\n }\n : undefined\n resolveWebAutoImportTag = createAutoImportTagResolver()\n await scan(this)\n const componentDependencies = await collectExternalComponentOptimizeDeps(state.scanResult.components)\n const uniAppIncludes = options.__uniApp?.include ?? []\n config.optimizeDeps ??= {}\n config.optimizeDeps.exclude = Array.from(new Set([\n ...(config.optimizeDeps.exclude ?? []),\n ...uniAppIncludes,\n ]))\n config.optimizeDeps.include = Array.from(new Set([\n ...(config.optimizeDeps.include ?? []),\n ...componentDependencies,\n ])).filter(dependency => !isUniAppDependency(dependency, uniAppIncludes))\n },\n configureServer(server: WebDevServer) {\n devServer = server\n server.middlewares.use(createWebAssetMiddleware(srcRoot))\n },\n async buildStart(this: WebPluginContext) {\n if (!resolveWebModuleId && this.resolve) {\n resolveWebModuleId = async (source, importer) => {\n const resolved = await this.resolve?.(source, importer, { skipSelf: true })\n return await resolveMiniProgramModuleId?.(resolved?.id ?? source, importer)\n ?? await resolveMiniProgramModuleId?.(source, importer)\n ?? resolved?.id\n }\n }\n resolveWebAutoImportTag = createAutoImportTagResolver()\n await scan(this)\n if (!enableHmr) {\n await emitWebAssets(this, srcRoot)\n }\n },\n resolveId(id: string, importer?: string) {\n const runtimeModule = webRuntimeModules.get(id)\n if (runtimeModule) {\n return runtimeModule\n }\n if (id === '/@weapp-vite/web/entry' || id === '@weapp-vite/web/entry') {\n return ENTRY_ID\n }\n if (id === AUTO_ROUTES_ID) {\n return RESOLVED_AUTO_ROUTES_ID\n }\n if (id.startsWith(WEB_COMPONENT_PREFIX)) {\n const request = decodeURIComponent(id.slice(WEB_COMPONENT_PREFIX.length))\n const resolvedId = componentImportIdMap.get(request)\n return resolvedId ? `${cleanUrl(resolvedId)}?${WEB_COMPONENT_QUERY}` : null\n }\n if (id.startsWith('.') && importer && cleanUrl(importer).endsWith('.vue') && !extname(id)) {\n const resolvedScript = resolveFileWithExtensionsSync(resolve(dirname(cleanUrl(importer)), id), SCRIPT_EXTS)\n if (resolvedScript?.endsWith('.vue')) {\n return resolvedScript\n }\n }\n if (hasQuery(id, SFC_STYLE_QUERY)) {\n const queryIndex = id.indexOf('?')\n const pathname = queryIndex >= 0 ? id.slice(0, queryIndex) : id\n const query = queryIndex >= 0 ? id.slice(queryIndex) : ''\n if (pathname.startsWith('.') && importer) {\n return `${resolve(dirname(cleanUrl(importer)), pathname)}${query}`\n }\n return id\n }\n return resolveMiniProgramModuleId?.(id, importer).then(resolved => resolved ?? null) ?? null\n },\n async load(this: WebPluginContext, id: string) {\n if (id === ENTRY_ID) {\n await scanQueue\n return generateEntryModule(state.scanResult, root, wxssOptions, options)\n }\n if (id === RESOLVED_AUTO_ROUTES_ID) {\n await scanQueue\n return generateAutoRoutesModule(state.scanResult)\n }\n if (hasQuery(id, TEMPLATE_QUERY)) {\n const filename = cleanUrl(id)\n let source = await readFile(filename, 'utf8')\n const pageMeta = resolveMetaByTemplate(filename)\n if (pageMeta?.kind === 'page' && state.scanResult.layouts.length) {\n source = wrapPageTemplate(source, state.scanResult.layouts)\n }\n const navigationConfig = state.pageNavigationMap.get(normalizePath(filename))\n const componentTags = state.templateComponentMap.get(normalizePath(filename))\n const compileTemplate = pageMeta ? compileWxml : compileWxmlDependency\n const compiled = compileTemplate({\n id: filename,\n source,\n resolveTemplatePath,\n resolveWxsPath,\n navigationBar: navigationConfig ? { config: navigationConfig } : undefined,\n componentTags,\n })\n for (const dependency of compiled.dependencies) {\n this.addWatchFile?.(dependency)\n }\n for (const warning of compiled.warnings ?? []) {\n this.warn?.(warning)\n }\n return compiled.code\n }\n if (hasWxsQuery(id)) {\n const filename = cleanUrl(id)\n const source = await readFile(filename, 'utf8')\n const compiled = transformWxsToEsm(source, filename, {\n resolvePath: resolveWxsPath,\n toImportPath: (resolved, importer) => normalizePath(toRelativeImport(importer, resolved)),\n })\n for (const dependency of compiled.dependencies) {\n this.addWatchFile?.(dependency)\n }\n for (const warning of compiled.warnings ?? []) {\n this.warn?.(warning)\n }\n return compiled.code\n }\n if (hasQuery(id, STYLE_QUERY)) {\n const source = await readFile(cleanUrl(id), 'utf8')\n const { css } = transformWxssToCss(source, wxssOptions)\n return createInlineStyleModule(css)\n }\n if (id.includes(`?${SFC_TEMPLATE_QUERY}`) || id.includes(`&${SFC_TEMPLATE_QUERY}`)) {\n const filename = cleanUrl(id)\n const meta = state.moduleMeta.get(normalizePath(filename))\n if (!meta) {\n return null\n }\n const result = await ensureWebVueSfcResult({\n filename,\n meta,\n srcRoot,\n state,\n resolveId: resolveWebModuleId,\n resolveAutoImportTag: resolveWebAutoImportTag,\n uniApp: options.__uniApp,\n stylePreprocessOptions,\n })\n const compiled = generateWebVueSfcTemplate(result, meta, filename, srcRoot)\n for (const dependency of compiled.dependencies) {\n this.addWatchFile?.(dependency)\n }\n for (const warning of compiled.warnings ?? []) {\n this.warn?.(warning)\n }\n return compiled.code\n }\n if (id.includes(`?${SFC_STYLE_QUERY}`) || id.includes(`&${SFC_STYLE_QUERY}`)) {\n const filename = resolveSfcStyleSourceFilename(id)\n const meta = state.moduleMeta.get(normalizePath(filename))\n if (!meta) {\n return null\n }\n const result = await ensureWebVueSfcResult({\n filename,\n meta,\n srcRoot,\n state,\n resolveId: resolveWebModuleId,\n resolveAutoImportTag: resolveWebAutoImportTag,\n uniApp: options.__uniApp,\n stylePreprocessOptions,\n })\n this.addWatchFile?.(filename)\n for (const dependency of result.meta?.sfcSrcDeps ?? []) {\n this.addWatchFile?.(dependency)\n }\n return generateWebVueSfcStyle(result)\n }\n return null\n },\n watchChange: {\n order: 'post',\n sequential: true,\n async handler(this: WebPluginContext, id, change) {\n // Vite 的 handleHotUpdate 不处理增删;必须在结构性 HMR 前发布完整入口。\n if (enableHmr && change.event !== 'update') {\n await scanChangedFile(this, id)\n }\n },\n },\n async handleHotUpdate<Module extends object>(this: WebPluginContext, ctx: WebHmrContext<Module>) {\n const graph = devServer?.moduleGraph\n // 扫描排队期间仍可能发布前一轮拓扑;节点归属必须来自本轮实际提交的前后快照。\n // 保留前快照中的已删除 owner、外部块和旧样式后缀,同时用后快照识别恢复的 SFC。\n const snapshots = await scanChangedFile(this, ctx.file)\n const affected = graph\n ? collectSfcHmrModules(snapshots ?? [state], cleanUrl(ctx.file), graph, ctx.modules)\n : ctx.modules\n return ctx.modules || affected?.length ? affected : undefined\n },\n async transform(this: WebPluginContext, code: string, id: string) {\n const clean = cleanUrl(id)\n let uniAppTransformed = false\n\n if (\n options.__uniApp\n && isUniAppCompatibilityFile(clean, srcRoot, options.__uniApp.include)\n && !clean.endsWith('.vue')\n ) {\n const transformed = transformUniAppSource(code, { filename: clean, target: 'h5' })\n if (transformed.changed) {\n code = transformed.code\n uniAppTransformed = true\n }\n }\n\n if (\n hasQuery(id, TEMPLATE_QUERY)\n || hasWxsQuery(id)\n || hasQuery(id, STYLE_QUERY)\n || hasQuery(id, SFC_TEMPLATE_QUERY)\n || hasQuery(id, SFC_STYLE_QUERY)\n ) {\n return null\n }\n\n if (clean.endsWith('.vue')) {\n const normalized = normalizePath(clean)\n const meta = state.moduleMeta.get(normalized) ?? {\n kind: 'component' as const,\n id: getStableWebComponentId(clean, srcRoot),\n scriptPath: clean,\n sourceType: 'vue-sfc' as const,\n }\n state.moduleMeta.set(normalized, meta)\n const result = await ensureWebVueSfcResult({\n filename: clean,\n meta,\n srcRoot,\n state,\n source: code,\n resolveId: resolveWebModuleId,\n resolveAutoImportTag: resolveWebAutoImportTag,\n uniApp: options.__uniApp,\n stylePreprocessOptions,\n })\n return transformWebVueSfcScript({\n code: result.script!,\n filename: clean,\n meta,\n runtimeModuleId: runtimeProvider?.moduleId ?? toViteFsImport(resolveRuntimePolyfillPath()),\n styleLanguage: resolveWebVueSfcStyleLanguage(result, clean),\n enableHmr,\n hmrAcceptCode,\n })\n }\n\n if (isTemplateFile(clean)) {\n if (isHtmlEntry(clean, root)) {\n return null\n }\n const normalizedId = normalizePath(clean)\n if (state.templatePathSet.size > 0) {\n if (!isInsideDir(clean, srcRoot)) {\n return null\n }\n if (!state.templatePathSet.has(normalizedId)) {\n return null\n }\n }\n let templateSource = code\n const pageMeta = resolveMetaByTemplate(clean)\n if (pageMeta?.kind === 'page' && state.scanResult.layouts.length) {\n templateSource = wrapPageTemplate(code, state.scanResult.layouts)\n }\n const navigationConfig = state.pageNavigationMap.get(normalizedId)\n const componentTags = state.templateComponentMap.get(normalizedId)\n const { code: compiled, dependencies, warnings } = compileWxml({\n id: clean,\n source: templateSource,\n resolveTemplatePath,\n resolveWxsPath,\n navigationBar: navigationConfig ? { config: navigationConfig } : undefined,\n componentTags,\n })\n const addWatchFile = this.addWatchFile\n if (dependencies.length > 0 && addWatchFile) {\n for (const dep of dependencies) {\n addWatchFile.call(this, dep)\n }\n }\n const warn = this.warn\n if (warnings?.length && warn) {\n for (const warning of warnings) {\n warn.call(this, warning)\n }\n }\n return { code: compiled, map: null }\n }\n\n if (isWxsFile(clean) || hasWxsQuery(id)) {\n const { code: compiled, dependencies, warnings } = transformWxsToEsm(code, clean, {\n resolvePath: resolveWxsPath,\n toImportPath: (resolved, importer) => normalizePath(toRelativeImport(importer, resolved)),\n })\n const addWatchFile = this.addWatchFile\n if (dependencies.length > 0 && addWatchFile) {\n for (const dep of dependencies) {\n addWatchFile.call(this, dep)\n }\n }\n const warn = this.warn\n if (warnings?.length && warn) {\n for (const warning of warnings) {\n warn.call(this, warning)\n }\n }\n return { code: compiled, map: null }\n }\n\n if (TRANSFORM_STYLE_EXTS.some(ext => clean.endsWith(ext))) {\n const { css } = transformWxssToCss(code, wxssOptions)\n return {\n code: createInlineStyleModule(css),\n map: null,\n }\n }\n\n if (STYLE_EXTS.some(ext => clean.endsWith(ext)) && !clean.endsWith('.wxss')) {\n const { css } = transformWxssToCss(code, wxssOptions)\n return { code: css, map: null }\n }\n\n if (!SCRIPT_EXTS.some(ext => clean.endsWith(ext))) {\n return uniAppTransformed ? { code, map: null } : null\n }\n if (clean.includes('node_modules') && !hasQuery(id, WEB_COMPONENT_QUERY)) {\n return options.__uniApp && isUniAppCompatibilityFile(clean, srcRoot, options.__uniApp.include)\n ? { code, map: null }\n : null\n }\n\n const meta = state.moduleMeta.get(normalizePath(clean))\n if (!meta) {\n return null\n }\n\n return transformScriptModule({\n code,\n cleanId: clean,\n meta,\n enableHmr,\n runtimeModuleId: runtimeProvider?.moduleId,\n hmrAcceptCode,\n })\n },\n }\n}\n\nexport type { WeappWebPluginOptions } from './types'\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAyBA,MAAM,yBAAyB;CAC7B;CACA;CACA;AACF;AAEA,MAAM,0BAA0B,CAAC,UAAU,uBAAuB;AAElE,SAAS,eAAe,IAAY;CAClC,MAAM,QAAQ,GAAG,YAAY;CAC7B,OAAO,cAAc,MAAK,QAAO,MAAM,SAAS,GAAG,CAAC;AACtD;AAEA,SAAS,UAAU,IAAY;CAC7B,MAAM,QAAQ,GAAG,YAAY;CAC7B,OAAO,SAAS,MAAK,QAAO,MAAM,SAAS,GAAG,CAAC;AACjD;AAEA,SAAS,YAAY,IAAY;CAC/B,OAAO,GAAG,SAAS,MAAM,KAAK,GAAG,SAAS,MAAM;AAClD;AAEA,SAAS,SAAS,IAAY,OAAe;CAC3C,OAAO,GAAG,SAAS,IAAI,OAAO,KAAK,GAAG,SAAS,IAAI,OAAO;AAC5D;AAEA,SAAS,mBAAmB,IAAY,UAA6B;CACnE,OAAO,SAAS,MAAK,gBAAe,OAAO,eAAe,GAAG,WAAW,GAAG,YAAY,EAAE,CAAC;AAC5F;AAEA,SAAS,8BAA8B,IAAY;CACjD,MAAM,WAAW,SAAS,EAA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cAAc,KAAK,CAAC;GACtD,IAAI,CAAC,MACH,OAAO;GAGT,OAAO,sBAAsB;IAC3B;IACA,SAAS;IACT;IACA;IACA,iBAAiB,iBAAiB;IAClC;GACF,CAAC;EACH;CACF;AACF"}
|
package/dist/plugin/layout.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/plugin/layout.ts
|
|
2
2
|
function collectLayoutPropKeys(layouts) {
|
|
3
3
|
const keys = /* @__PURE__ */ new Set();
|
|
4
4
|
for (const layout of layouts) {
|
|
@@ -19,6 +19,5 @@ function wrapPageTemplate(source, layouts) {
|
|
|
19
19
|
}).join("")}<block wx:else>${source}</block>`;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
//#endregion
|
|
23
22
|
export { wrapPageTemplate };
|
|
24
23
|
//# sourceMappingURL=layout.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/plugin/navigation.ts
|
|
2
2
|
function pickNavigationConfig(source) {
|
|
3
3
|
const config = {};
|
|
4
4
|
if (!source) return config;
|
|
@@ -15,6 +15,5 @@ function mergeNavigationConfig(base, overrides) {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
//#endregion
|
|
19
18
|
export { mergeNavigationConfig, pickNavigationConfig };
|
|
20
19
|
//# sourceMappingURL=navigation.mjs.map
|
|
@@ -2,7 +2,7 @@ import { resolveScriptFile } from "./files.mjs";
|
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import { dirname, resolve } from "pathe";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/plugin/packageResolution.ts
|
|
6
6
|
function parsePackageSubpath(id, packageRootRelative = false) {
|
|
7
7
|
const segments = id.split("/");
|
|
8
8
|
const packageSegmentCount = id.startsWith("@") ? 2 : 1;
|
|
@@ -66,6 +66,5 @@ function createMiniProgramPackageResolver(resolvePackage) {
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
//#endregion
|
|
70
69
|
export { createMiniProgramPackageResolver, getAncestorNodeModulesPaths };
|
|
71
70
|
//# sourceMappingURL=packageResolution.mjs.map
|
package/dist/plugin/path.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { dirname, extname, normalize, posix, relative, resolve } from "pathe";
|
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/plugin/path.ts
|
|
7
7
|
function cleanUrl(url) {
|
|
8
8
|
const queryIndex = url.indexOf("?");
|
|
9
9
|
if (queryIndex >= 0) return url.slice(0, queryIndex);
|
|
@@ -84,6 +84,5 @@ function resolveWxsPathSync(raw, importer, srcRoot) {
|
|
|
84
84
|
return resolveFileWithExtensionsSync(base, WXS_RESOLVE_EXTS);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
-
//#endregion
|
|
88
87
|
export { appendInlineQuery, appendQuery, cleanUrl, isHtmlEntry, isInsideDir, normalizePath, relativeModuleId, resolveFileWithExtensionsSync, resolveImportBase, resolveRuntimePolyfillPath, resolveTemplatePathSync, resolveWxsPathSync, toPosixId, toRelativeImport, toViteFsImport };
|
|
89
88
|
//# sourceMappingURL=path.mjs.map
|
package/dist/plugin/register.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import _babelTraverse from "@babel/traverse";
|
|
|
6
6
|
import * as t from "@babel/types";
|
|
7
7
|
import MagicString from "magic-string";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
// src/plugin/register.ts
|
|
10
10
|
function resolveBabelTraverse(mod) {
|
|
11
11
|
if (typeof mod === "function") return mod;
|
|
12
12
|
if (mod?.default && typeof mod.default === "function") return mod.default;
|
|
@@ -107,6 +107,5 @@ function transformScriptModule({ code, cleanId, meta, enableHmr, runtimeModuleId
|
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
//#endregion
|
|
111
110
|
export { resolveBabelTraverse, transformScriptModule };
|
|
112
111
|
//# sourceMappingURL=register.mjs.map
|
package/dist/plugin/scan.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { readdir } from "node:fs/promises";
|
|
|
10
10
|
import process from "node:process";
|
|
11
11
|
import { dirname, extname, join, posix, relative, resolve } from "pathe";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// src/plugin/scan.ts
|
|
14
14
|
function getStableWebComponentId(script, srcRoot) {
|
|
15
15
|
const normalized = script.replace(/\\/g, "/");
|
|
16
16
|
const nodeModulesIndex = normalized.lastIndexOf("/node_modules/");
|
|
@@ -312,6 +312,5 @@ async function scanProject({ srcRoot, warn, state, resolveId, resolveAutoImportT
|
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
-
//#endregion
|
|
316
315
|
export { getStableWebComponentId, scanProject };
|
|
317
316
|
//# sourceMappingURL=scan.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readJsonFile, resolveJsonPath } from "./files.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/plugin/scanConfig.ts
|
|
4
4
|
async function collectComponentTagsFromConfig({ json, importerDir, jsonPath, warn, resolveComponentScript, getComponentTag, collectComponent, onResolved }) {
|
|
5
5
|
const usingComponents = json.usingComponents;
|
|
6
6
|
if (!usingComponents || typeof usingComponents !== "object") return {};
|
|
@@ -40,6 +40,5 @@ function normalizeComponentKey(raw) {
|
|
|
40
40
|
return raw.trim().toLowerCase();
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
//#endregion
|
|
44
43
|
export { collectComponentTagsFromConfig, collectComponentTagsFromJson, mergeComponentTags };
|
|
45
44
|
//# sourceMappingURL=scanConfig.mjs.map
|
package/dist/plugin/scanSfc.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { compileWebVueSfc } from "./vueSfc.mjs";
|
|
|
4
4
|
import { readFile, readdir } from "node:fs/promises";
|
|
5
5
|
import path from "pathe";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// src/plugin/scanSfc.ts
|
|
8
8
|
const PAGE_SEGMENT = "pages";
|
|
9
9
|
const EXCLUDED_PAGE_SEGMENTS = /* @__PURE__ */ new Set([
|
|
10
10
|
"components",
|
|
@@ -60,6 +60,5 @@ async function discoverWebPageIds(srcRoot) {
|
|
|
60
60
|
return [...pageIds];
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
//#endregion
|
|
64
63
|
export { compileScannedSfc, discoverWebPageIds, parseSfcJsonConfig };
|
|
65
64
|
//# sourceMappingURL=scanSfc.mjs.map
|
package/dist/plugin/sfcHmr.mjs
CHANGED
|
@@ -1,19 +1,37 @@
|
|
|
1
1
|
import { normalizePath } from "./path.mjs";
|
|
2
2
|
import { resolveWebVueSfcStyleLanguage } from "./vueSfc.mjs";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
// src/plugin/sfcHmr.ts
|
|
5
|
+
function reachesSfcOwner(module, owners) {
|
|
6
|
+
const pending = [module];
|
|
7
|
+
const visited = /* @__PURE__ */ new Set();
|
|
8
|
+
while (pending.length) {
|
|
9
|
+
const current = pending.pop();
|
|
10
|
+
if (owners.has(current)) return true;
|
|
11
|
+
if (!visited.has(current)) {
|
|
12
|
+
visited.add(current);
|
|
13
|
+
pending.push(...current.importers);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
/** 只将仍连接到 SFC 注册模块的派生节点交给 Vite,避免删除恢复后旧节点触发额外刷新。 */
|
|
19
|
+
function collectSfcHmrModules(states, changedFile, graph, modules) {
|
|
7
20
|
const changed = normalizePath(changedFile);
|
|
8
|
-
const
|
|
9
|
-
|
|
21
|
+
const owners = /* @__PURE__ */ new Set();
|
|
22
|
+
const candidates = /* @__PURE__ */ new Set();
|
|
23
|
+
for (const state of states) for (const [filename, result] of state.sfcResults) {
|
|
10
24
|
if (filename !== changed && !result.meta?.sfcSrcDeps?.some((dependency) => normalizePath(dependency) === changed)) continue;
|
|
11
|
-
|
|
12
|
-
|
|
25
|
+
for (const file of [filename, `${filename}.${resolveWebVueSfcStyleLanguage(result, filename)}`]) for (const module of graph.getModulesByFile(file) ?? []) {
|
|
26
|
+
candidates.add(module);
|
|
27
|
+
if (module.id && normalizePath(module.id) === filename) owners.add(module);
|
|
28
|
+
}
|
|
13
29
|
}
|
|
14
|
-
|
|
30
|
+
const affected = new Set(modules);
|
|
31
|
+
for (const module of candidates) if (reachesSfcOwner(module, owners)) affected.add(module);
|
|
32
|
+
else affected.delete(module);
|
|
33
|
+
return [...affected];
|
|
15
34
|
}
|
|
16
35
|
|
|
17
|
-
|
|
18
|
-
export { collectSfcHmrFiles };
|
|
36
|
+
export { collectSfcHmrModules };
|
|
19
37
|
//# sourceMappingURL=sfcHmr.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sfcHmr.mjs","names":[],"sources":["../../src/plugin/sfcHmr.ts"],"sourcesContent":["import type { ScanState } from './types'\nimport { normalizePath } from './path'\nimport { resolveWebVueSfcStyleLanguage } from './vueSfc'\n\n/**
|
|
1
|
+
{"version":3,"file":"sfcHmr.mjs","names":[],"sources":["../../src/plugin/sfcHmr.ts"],"sourcesContent":["import type { ModuleNode } from 'vite'\nimport type { WebDevServer } from './hostTypes'\nimport type { ScanState } from './types'\nimport { normalizePath } from './path'\nimport { resolveWebVueSfcStyleLanguage } from './vueSfc'\n\nfunction reachesSfcOwner(module: ModuleNode, owners: Set<ModuleNode>) {\n const pending = [module]\n const visited = new Set<ModuleNode>()\n while (pending.length) {\n const current = pending.pop()!\n if (owners.has(current)) {\n return true\n }\n if (!visited.has(current)) {\n visited.add(current)\n pending.push(...current.importers)\n }\n }\n return false\n}\n\n/** 只将仍连接到 SFC 注册模块的派生节点交给 Vite,避免删除恢复后旧节点触发额外刷新。 */\nexport function collectSfcHmrModules<Module extends object>(\n states: readonly ScanState[],\n changedFile: string,\n graph: NonNullable<WebDevServer['moduleGraph']>,\n modules?: Module[],\n) {\n const changed = normalizePath(changedFile)\n const owners = new Set<ModuleNode>()\n const candidates = new Set<ModuleNode>()\n for (const state of states) {\n for (const [filename, result] of state.sfcResults) {\n if (filename !== changed && !result.meta?.sfcSrcDeps?.some(dependency => normalizePath(dependency) === changed)) {\n continue\n }\n for (const file of [filename, `${filename}.${resolveWebVueSfcStyleLanguage(result, filename)}`]) {\n for (const module of graph.getModulesByFile(file) ?? []) {\n candidates.add(module)\n if (module.id && normalizePath(module.id) === filename) {\n owners.add(module)\n }\n }\n }\n }\n }\n const affected = new Set(modules)\n for (const module of candidates) {\n // Vite 的 unlink 会拆除反向依赖,但保留旧文件节点;仅有节点身份不能证明它仍属于当前 SFC。\n if (reachesSfcOwner(module, owners)) {\n affected.add(module as Module)\n }\n else {\n affected.delete(module as Module)\n }\n }\n return [...affected]\n}\n"],"mappings":";;;;AAMA,SAAS,gBAAgB,QAAoB,QAAyB;CACpE,MAAM,UAAU,CAAC,MAAM;CACvB,MAAM,0BAAU,IAAI,IAAgB;CACpC,OAAO,QAAQ,QAAQ;EACrB,MAAM,UAAU,QAAQ,IAAI;EAC5B,IAAI,OAAO,IAAI,OAAO,GACpB,OAAO;EAET,IAAI,CAAC,QAAQ,IAAI,OAAO,GAAG;GACzB,QAAQ,IAAI,OAAO;GACnB,QAAQ,KAAK,GAAG,QAAQ,SAAS;EACnC;CACF;CACA,OAAO;AACT;;AAGA,SAAgB,qBACd,QACA,aACA,OACA,SACA;CACA,MAAM,UAAU,cAAc,WAAW;CACzC,MAAM,yBAAS,IAAI,IAAgB;CACnC,MAAM,6BAAa,IAAI,IAAgB;CACvC,KAAK,MAAM,SAAS,QAClB,KAAK,MAAM,CAAC,UAAU,WAAW,MAAM,YAAY;EACjD,IAAI,aAAa,WAAW,CAAC,OAAO,MAAM,YAAY,MAAK,eAAc,cAAc,UAAU,MAAM,OAAO,GAC5G;EAEF,KAAK,MAAM,QAAQ,CAAC,UAAU,GAAG,SAAS,GAAG,8BAA8B,QAAQ,QAAQ,GAAG,GAC5F,KAAK,MAAM,UAAU,MAAM,iBAAiB,IAAI,KAAK,CAAC,GAAG;GACvD,WAAW,IAAI,MAAM;GACrB,IAAI,OAAO,MAAM,cAAc,OAAO,EAAE,MAAM,UAC5C,OAAO,IAAI,MAAM;EAErB;CAEJ;CAEF,MAAM,WAAW,IAAI,IAAI,OAAO;CAChC,KAAK,MAAM,UAAU,YAEnB,IAAI,gBAAgB,QAAQ,MAAM,GAChC,SAAS,IAAI,MAAgB;MAG7B,SAAS,OAAO,MAAgB;CAGpC,OAAO,CAAC,GAAG,QAAQ;AACrB"}
|
package/dist/plugin/state.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/plugin/state.ts
|
|
2
2
|
function createEmptyScanState() {
|
|
3
3
|
return {
|
|
4
4
|
moduleMeta: /* @__PURE__ */ new Map(),
|
|
@@ -18,6 +18,5 @@ function createEmptyScanState() {
|
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
//#endregion
|
|
22
21
|
export { createEmptyScanState };
|
|
23
22
|
//# sourceMappingURL=state.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/plugin/styleModule.ts
|
|
2
2
|
function createInlineStyleModule(css) {
|
|
3
3
|
return [
|
|
4
4
|
`const __weapp_injected_styles__ = new Map()`,
|
|
@@ -47,6 +47,5 @@ function createInlineStyleModule(css) {
|
|
|
47
47
|
].join("\n");
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
//#endregion
|
|
51
50
|
export { createInlineStyleModule };
|
|
52
51
|
//# sourceMappingURL=styleModule.mjs.map
|
package/dist/plugin/types.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { WxssTransformOptions } from "../
|
|
1
|
+
import { WxssTransformOptions } from "../shared/styleUnits/options.mjs";
|
|
2
|
+
import "../css/wxss.mjs";
|
|
2
3
|
import { WebRoutingConfig } from "../runtime/polyfill/routeRuntime/history.mjs";
|
|
3
4
|
import { WebResourceHintsConfig, WebRuntimeSeoConfig as WebSeoConfig } from "../runtime/seo/index.mjs";
|
|
4
5
|
import "wevu/compiler";
|
|
5
|
-
//#region src/plugin/types.d.ts
|
|
6
6
|
export interface WeappWebPluginOptions {
|
|
7
7
|
wxss?: WxssTransformOptions;
|
|
8
8
|
/**
|
|
@@ -86,5 +86,4 @@ export type WebComponentResolver = {
|
|
|
86
86
|
resolve?: (componentName: string, baseName: string) => WebResolvedComponent | void;
|
|
87
87
|
} | ((componentName: string, baseName: string) => WebResolvedComponent | void);
|
|
88
88
|
export type ResolveWebModuleId = (source: string, importer?: string) => Promise<string | undefined>;
|
|
89
|
-
//#endregion
|
|
90
89
|
//# sourceMappingURL=types.d.mts.map
|
package/dist/plugin/vueSfc.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import _babelTraverse from "@babel/traverse";
|
|
|
10
10
|
import * as t from "@babel/types";
|
|
11
11
|
import MagicString from "magic-string";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
// src/plugin/vueSfc.ts
|
|
14
14
|
const traverse = _babelTraverse;
|
|
15
15
|
const webTemplatePlatform = {
|
|
16
16
|
...getMiniProgramTemplatePlatform("weapp"),
|
|
@@ -149,6 +149,5 @@ function generateWebVueSfcStyle(result) {
|
|
|
149
149
|
return result.style ?? "";
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
//#endregion
|
|
153
152
|
export { compileWebVueSfc, ensureWebVueSfcResult, generateWebVueSfcStyle, generateWebVueSfcTemplate, resolveWebVueSfcStyleLanguage, transformWebVueSfcScript };
|
|
154
153
|
//# sourceMappingURL=vueSfc.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/appShell/container.ts
|
|
2
2
|
function onDocumentReady(callback) {
|
|
3
3
|
if (typeof document === "undefined") return;
|
|
4
4
|
if (document.readyState === "loading") {
|
|
@@ -20,6 +20,5 @@ function ensureAppContainer() {
|
|
|
20
20
|
return container;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
//#endregion
|
|
24
23
|
export { ensureAppContainer, getAppContainer, onDocumentReady };
|
|
25
24
|
//# sourceMappingURL=container.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ensureAppContainer, getAppContainer, onDocumentReady } from "../container.mjs";
|
|
2
2
|
import { TAB_BAR_STYLE } from "./style.mjs";
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
// src/runtime/appShell/tabBar/index.ts
|
|
5
5
|
const TAB_BAR_TAG = "weapp-tab-bar";
|
|
6
6
|
const TAB_BAR_HEIGHT = "50px";
|
|
7
7
|
const BaseElement = globalThis.HTMLElement ?? class {};
|
|
@@ -187,6 +187,5 @@ function setTabBarRedDotState(index, redDot) {
|
|
|
187
187
|
return true;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
-
//#endregion
|
|
191
190
|
export { configureTabBar, ensureTabBarDefined, getTabBarPagePaths, setTabBarBadgeState, setTabBarRedDotState, setTabBarVisible, syncTabBarRoute, updateTabBarItem, updateTabBarStyle };
|
|
192
191
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/appShell/tabBar/style.ts
|
|
2
2
|
const TAB_BAR_STYLE = `
|
|
3
3
|
:host {
|
|
4
4
|
--weapp-tab-bar-color: #7a7e83;
|
|
@@ -122,6 +122,5 @@ const TAB_BAR_STYLE = `
|
|
|
122
122
|
}
|
|
123
123
|
`;
|
|
124
124
|
|
|
125
|
-
//#endregion
|
|
126
125
|
export { TAB_BAR_STYLE };
|
|
127
126
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { injectStyle, removeStyle } from "./style.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/runtime/appStyle.ts
|
|
4
4
|
const styleId = "weapp-web-app-style";
|
|
5
5
|
const consumers = /* @__PURE__ */ new Set();
|
|
6
6
|
let appStyle = "";
|
|
@@ -20,6 +20,5 @@ function trackAppStyle(consumer, enabled) {
|
|
|
20
20
|
else consumers.delete(consumer);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
//#endregion
|
|
24
23
|
export { getAppStyle, setAppStyle, trackAppStyle };
|
|
25
24
|
//# sourceMappingURL=appStyle.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/button/helpers.ts
|
|
2
2
|
const DEFAULT_HOVER_CLASS = "button-hover";
|
|
3
3
|
function toBoolean(value) {
|
|
4
4
|
if (value === null) return false;
|
|
@@ -30,6 +30,5 @@ function isInternalNode(node) {
|
|
|
30
30
|
return node instanceof HTMLElement && node.dataset?.weappInternal === "true";
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
//#endregion
|
|
34
33
|
export { getHoverClass, isDisabled, isInternalNode, normalizeType, parseNumber, toBoolean };
|
|
35
34
|
//# sourceMappingURL=helpers.mjs.map
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { FormConfig } from "../nativeComponents/form.mjs";
|
|
2
|
-
//#region src/runtime/button/index.d.ts
|
|
3
2
|
export declare function ensureButtonDefined(): void;
|
|
4
3
|
export declare function setButtonFormConfig(next: FormConfig): void;
|
|
5
4
|
export type ButtonFormConfig = FormConfig;
|
|
6
|
-
//#endregion
|
|
7
5
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -3,7 +3,7 @@ import { setFormConfig } from "../nativeComponents/form.mjs";
|
|
|
3
3
|
import { getHoverClass, isDisabled, isInternalNode, normalizeType, parseNumber, toBoolean } from "./helpers.mjs";
|
|
4
4
|
import { ensureButtonStyle } from "./style.mjs";
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// src/runtime/button/index.ts
|
|
7
7
|
const NAV_BUTTON_TAG = "weapp-button";
|
|
8
8
|
const BaseElement = globalThis.HTMLElement ?? class {};
|
|
9
9
|
var WeappButton = class extends BaseElement {
|
|
@@ -171,6 +171,5 @@ function setButtonFormConfig(next) {
|
|
|
171
171
|
setFormConfig(next);
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
//#endregion
|
|
175
174
|
export { WeappButton, ensureButtonDefined, setButtonFormConfig };
|
|
176
175
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { injectStyle } from "../style.mjs";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/runtime/button/style.ts
|
|
4
4
|
const BUTTON_STYLE_ID = "weapp-web-button-style";
|
|
5
5
|
const styleTargets = /* @__PURE__ */ new WeakSet();
|
|
6
6
|
let sharedSheet;
|
|
@@ -188,6 +188,5 @@ function ensureButtonStyle(root) {
|
|
|
188
188
|
styleTargets.add(root);
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
-
//#endregion
|
|
192
191
|
export { BUTTON_STYLE, ensureButtonStyle };
|
|
193
192
|
//# sourceMappingURL=style.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/component/behavior.ts
|
|
2
2
|
function isPlainObject(value) {
|
|
3
3
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
4
4
|
}
|
|
@@ -117,6 +117,5 @@ function normalizeBehaviors(component) {
|
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
//#endregion
|
|
121
120
|
export { normalizeBehaviors };
|
|
122
121
|
//# sourceMappingURL=behavior.mjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/runtime/component/constants.ts
|
|
2
2
|
const supportsLit = typeof document !== "undefined" && typeof document.createComment === "function" && typeof document.createTreeWalker === "function";
|
|
3
3
|
const FallbackElement = class {};
|
|
4
4
|
const EVENT_ATTRIBUTE_NAME_ESCAPE_RE = /[A-Z_]/g;
|
|
@@ -16,6 +16,5 @@ const WECHAT_LEGACY_EVENT_FLAG_ATTRIBUTE_PREFIX = "data-wx-on-flags-";
|
|
|
16
16
|
const EVENT_ATTRIBUTE_PREFIXES = [MINI_PROGRAM_EVENT_ATTRIBUTE_PREFIX, WECHAT_LEGACY_EVENT_ATTRIBUTE_PREFIX];
|
|
17
17
|
const EVENT_FLAG_ATTRIBUTE_PREFIXES = [MINI_PROGRAM_EVENT_FLAG_ATTRIBUTE_PREFIX, WECHAT_LEGACY_EVENT_FLAG_ATTRIBUTE_PREFIX];
|
|
18
18
|
|
|
19
|
-
//#endregion
|
|
20
19
|
export { EVENT_ATTRIBUTE_PREFIXES, EVENT_FLAG_ATTRIBUTE_PREFIXES, FallbackElement, MINI_PROGRAM_EVENT_ATTRIBUTE_PREFIX, MINI_PROGRAM_EVENT_FLAG_ATTRIBUTE_PREFIX, WECHAT_LEGACY_EVENT_ATTRIBUTE_PREFIX, WECHAT_LEGACY_EVENT_FLAG_ATTRIBUTE_PREFIX, decodeEventAttributeName, encodeEventAttributeName, supportsLit };
|
|
21
20
|
//# sourceMappingURL=constants.mjs.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getMiniProgramRuntimeGlobalKeys } from "@weapp-core/shared/platforms/runtime";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// src/runtime/component/dom.ts
|
|
4
4
|
const MINI_PROGRAM_RUNTIME_GLOBAL_KEYS = getMiniProgramRuntimeGlobalKeys();
|
|
5
5
|
function resolveQueryRoot(instance) {
|
|
6
6
|
return instance.renderRoot ?? instance.shadowRoot ?? instance;
|
|
@@ -27,6 +27,5 @@ function selectRuntimeComponents(instance, selector) {
|
|
|
27
27
|
return Array.from(root.querySelectorAll(selector));
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
//#endregion
|
|
31
30
|
export { createScopedSelectorQuery, resolveQueryRoot, resolveRenderRoot, selectRuntimeComponent, selectRuntimeComponents };
|
|
32
31
|
//# sourceMappingURL=dom.mjs.map
|