diff --git a/packages/uni-app-vite/dist/plugin/uni.js b/packages/uni-app-vite/dist/plugin/uni.js index cee00b5432489dd6be7270050dd7f730fd40c7d1..8d59b929e52740bd026e921bf922431f59e3d92b 100644 --- a/packages/uni-app-vite/dist/plugin/uni.js +++ b/packages/uni-app-vite/dist/plugin/uni.js @@ -9,14 +9,16 @@ const uni_shared_1 = require("@dcloudio/uni-shared"); const uni_cli_shared_1 = require("@dcloudio/uni-cli-shared"); function uniOptions() { return { - copyOptions: { - assets: ['hybrid/html'], - targets: [ - { - src: uni_cli_shared_1.normalizePath(path_1.default.resolve(process.env.UNI_INPUT_DIR, 'androidPrivacy.json')), - dest: process.env.UNI_OUTPUT_DIR, - }, - ], + copyOptions() { + return { + assets: ['hybrid/html'], + targets: [ + { + src: uni_cli_shared_1.normalizePath(path_1.default.resolve(process.env.UNI_INPUT_DIR, 'androidPrivacy.json')), + dest: process.env.UNI_OUTPUT_DIR, + }, + ], + }; }, compilerOptions: { isNativeTag: uni_shared_1.isServiceNativeTag, diff --git a/packages/uni-app-vite/src/plugin/uni.ts b/packages/uni-app-vite/src/plugin/uni.ts index f3b1e5d3420162cfeb4c1530680940ce027e250e..959219a83eabee199420ee954ab8232175e9ac00 100644 --- a/packages/uni-app-vite/src/plugin/uni.ts +++ b/packages/uni-app-vite/src/plugin/uni.ts @@ -7,16 +7,18 @@ import { normalizePath, UniVitePlugin } from '@dcloudio/uni-cli-shared' export function uniOptions(): UniVitePlugin['uni'] { return { - copyOptions: { - assets: ['hybrid/html'], - targets: [ - { - src: normalizePath( - path.resolve(process.env.UNI_INPUT_DIR, 'androidPrivacy.json') - ), - dest: process.env.UNI_OUTPUT_DIR, - }, - ], + copyOptions() { + return { + assets: ['hybrid/html'], + targets: [ + { + src: normalizePath( + path.resolve(process.env.UNI_INPUT_DIR, 'androidPrivacy.json') + ), + dest: process.env.UNI_OUTPUT_DIR, + }, + ], + } }, compilerOptions: { isNativeTag: isServiceNativeTag, diff --git a/packages/uni-cli-shared/src/vite/index.ts b/packages/uni-cli-shared/src/vite/index.ts index f94afd60dadeffa981caf812dcc14e541586eea2..24d5a6218dc92e267de86b57796cf726ea4a187f 100644 --- a/packages/uni-cli-shared/src/vite/index.ts +++ b/packages/uni-cli-shared/src/vite/index.ts @@ -9,16 +9,18 @@ export interface CopyOptions { assets?: string[] targets?: readonly Target[] } -export interface UniVitePlugin extends Plugin { - uni?: { - compilerOptions?: { - isNativeTag: ParserOptions['isNativeTag'] - isCustomElement: ParserOptions['isCustomElement'] - directiveTransforms?: CompilerOptions['directiveTransforms'] - } - transformEvent?: Record - copyOptions?: CopyOptions | (() => CopyOptions) + +interface UniVitePluginUniOptions { + compilerOptions?: { + isNativeTag: ParserOptions['isNativeTag'] + isCustomElement: ParserOptions['isCustomElement'] + directiveTransforms?: CompilerOptions['directiveTransforms'] } + transformEvent?: Record + copyOptions?: CopyOptions | (() => CopyOptions) +} +export interface UniVitePlugin extends Plugin { + uni?: UniVitePluginUniOptions } export * from './utils'