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

feat(app): disable android privacy when test

上级 08b37658
......@@ -6,6 +6,7 @@ import {
transformPageHead,
transformMatchMedia,
transformTapToClick,
UniViteCopyPluginOptions,
} from '@dcloudio/uni-cli-shared'
export function uniOptions(): UniVitePlugin['uni'] {
......@@ -14,21 +15,24 @@ export function uniOptions(): UniVitePlugin['uni'] {
const platfrom = process.env.UNI_PLATFORM
const inputDir = process.env.UNI_INPUT_DIR
const outputDir = process.env.UNI_OUTPUT_DIR
const targets: UniViteCopyPluginOptions['targets'] = []
// 自动化测试时,不启用隐私政策
if (!process.env.UNI_AUTOMATOR_WS_ENDPOINT) {
targets.push({
src: 'androidPrivacy.json',
dest: outputDir,
transform(source) {
const options = initI18nOptions(platfrom, inputDir, false, true)
if (!options) {
return
}
return compileI18nJsonStr(source.toString(), options)
},
})
}
return {
assets: ['hybrid/html/**/*', 'uni_modules/*/hybrid/html/**/*'],
targets: [
{
src: 'androidPrivacy.json',
dest: outputDir,
transform(source) {
const options = initI18nOptions(platfrom, inputDir, false, true)
if (!options) {
return
}
return compileI18nJsonStr(source.toString(), options)
},
},
],
targets,
}
},
compilerOptions: {
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册