diff --git a/packages/vite-plugin-uni/src/vue/options.ts b/packages/vite-plugin-uni/src/vue/options.ts index 30857d7e984d35b816bc16d5a0381dc2dad9791b..5701c9e8571f68f728177a2c6c788ee7fdcb599a 100644 --- a/packages/vite-plugin-uni/src/vue/options.ts +++ b/packages/vite-plugin-uni/src/vue/options.ts @@ -136,11 +136,12 @@ export function initPluginVueOptions( createUniVueTransformAssetUrls( isExternalUrl(options.base) ? options.base : '' ) - templateOptions.transformAssetUrls = builtInTransformAssetUrls // 用户传递配置 eg: transformAssetUrls.tags = {'my-image': ['src']} // docs: https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue const userOptionsTransformAssetUrls = templateOptions.transformAssetUrls + + templateOptions.transformAssetUrls = builtInTransformAssetUrls if ( typeof userOptionsTransformAssetUrls !== 'boolean' && !!userOptionsTransformAssetUrls?.tags &&