提交 5ba05318 编写于 作者: fxy060608's avatar fxy060608

chore: lint

上级 47293ae3
......@@ -8,7 +8,7 @@ const PLATFORMS = [
'mp-baidu',
'mp-alipay',
'mp-toutiao',
'mp-jd',
'mp-jd'
]
module.exports = {
......
......@@ -231,7 +231,7 @@ function traverseDataNode (dataNode, state, node) {
let key
// 自定义组件不支持 hidden 属性
const platform = state.options.platform.name
const platforms = ['mp-weixin', 'mp-qq','mp-jd', 'mp-toutiao', 'mp-lark']
const platforms = ['mp-weixin', 'mp-qq', 'mp-jd', 'mp-toutiao', 'mp-lark']
if (isComponent(node.type) && platforms.includes(platform)) {
// 字节跳动|飞书小程序自定义属性不会反应在DOM上,只能使用事件格式
key = `${platform === 'mp-toutiao' || platform === 'mp-lark' ? 'bind:-' : ''}${ATTE_DATA_CUSTOM_HIDDEN}`
......
......@@ -213,15 +213,16 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
from: path.resolve(process.env.UNI_INPUT_DIR, 'static'),
to: 'static'
}]
const androidPrivacyPath = path.resolve(process.env.UNI_INPUT_DIR, 'androidPrivacy.json')
if (fs.existsSync(androidPrivacyPath)) {
array.push({
from: androidPrivacyPath,
to: 'androidPrivacy.json'
})
// 自动化测试时,不启用androidPrivacy.json
if (!process.env.UNI_AUTOMATOR_WS_ENDPOINT) {
const androidPrivacyPath = path.resolve(process.env.UNI_INPUT_DIR, 'androidPrivacy.json')
if (fs.existsSync(androidPrivacyPath)) {
array.push({
from: androidPrivacyPath,
to: 'androidPrivacy.json'
})
}
}
const hybridHtmlPath = path.resolve(process.env.UNI_INPUT_DIR, 'hybrid/html')
if (fs.existsSync(hybridHtmlPath)) {
array.push({
......@@ -389,4 +390,4 @@ module.exports = function () {
zlib: false
}
}
}
}
......@@ -48,7 +48,7 @@ module.exports = (api, options) => {
return buildManifestJson()
}
const platforms = ['mp-weixin', 'mp-qq','mp-jd', 'mp-baidu', 'mp-alipay', 'mp-toutiao', 'mp-lark']
const platforms = ['mp-weixin', 'mp-qq', 'mp-jd', 'mp-baidu', 'mp-alipay', 'mp-toutiao', 'mp-lark']
if (args.subpackage && platforms.includes(process.env.UNI_PLATFORM)) {
process.env.UNI_SUBPACKGE = args.subpackage
}
......
const fs = require('fs')
const path = require('path')
const { compileI18nJsonStr } = require('@dcloudio/uni-i18n')
const { initI18nOptions } = require('@dcloudio/uni-cli-shared/lib/i18n')
const {
compileI18nJsonStr
} = require('@dcloudio/uni-i18n')
const {
initI18nOptions
} = require('@dcloudio/uni-cli-shared/lib/i18n')
const assetsDir = 'static'
function getAssetsCopyOption (from, options = {}) {
if (path.isAbsolute(from)) {
if (fs.existsSync(from)) {
return Object.assign(
{
from,
to: path.resolve(process.env.UNI_OUTPUT_DIR)
},
options
return Object.assign({
from,
to: path.resolve(process.env.UNI_OUTPUT_DIR)
},
options
)
}
}
const to = from
from = path.resolve(process.env.UNI_INPUT_DIR, from)
if (fs.existsSync(from)) {
return Object.assign(
{
from,
to: path.resolve(process.env.UNI_OUTPUT_DIR, to)
},
options
return Object.assign({
from,
to: path.resolve(process.env.UNI_OUTPUT_DIR, to)
},
options
)
}
}
......@@ -50,8 +52,7 @@ function getAssetsCopyOptions (assetsDir) {
process.UNI_SUBPACKAGES &&
Object.keys(process.UNI_SUBPACKAGES).forEach(root => {
const subAssetsCopyOption = getAssetsCopyOption(
path.join(root, assetsDir),
{
path.join(root, assetsDir), {
ignore
}
)
......@@ -86,7 +87,8 @@ function getCopyWebpackPluginOptions (platformOptions, vueOptions) {
copyOption && copyOptions.push(copyOption)
})
})
if (process.env.UNI_PLATFORM === 'app-plus') {
// 自动化测试时,不启用androidPrivacy.json
if (process.env.UNI_PLATFORM === 'app-plus' && !process.env.UNI_AUTOMATOR_WS_ENDPOINT) {
copyOptions.push({
from: path.resolve(process.env.UNI_INPUT_DIR, 'android*.json'),
to: '[name].[ext]',
......@@ -116,4 +118,4 @@ function getCopyWebpackPluginOptions (platformOptions, vueOptions) {
module.exports = {
assetsDir,
getCopyWebpackPluginOptions
}
}
......@@ -47,7 +47,7 @@ module.exports = function generateApp (compilation) {
// 框架预设样式 用于隐藏自定义组件
// TODO 分平台 import 不同 css
const platforms = ['mp-weixin', 'mp-qq', 'mp-jd','mp-toutiao', 'mp-lark']
const platforms = ['mp-weixin', 'mp-qq', 'mp-jd', 'mp-toutiao', 'mp-lark']
const presetStyle = platforms.includes(process.env.UNI_PLATFORM) ? '[data-custom-hidden="true"],[bind-data-custom-hidden="true"]{display: none !important;}' : ''
if (compilation.assets[`common/main${ext}`]) { // 是否存在 main.css
......
......@@ -3,9 +3,9 @@ module.exports = function (pagesJson, manifestJson) {
app,
project
} = require('../mp')(pagesJson, manifestJson, require('./project.config.json'))
//暂不支持分包,兼容引擎判断
if(app.content.subPackages && !app.content.subPackages.length){
delete app.content.subPackages;
// 暂不支持分包,兼容引擎判断
if (app.content.subPackages && !app.content.subPackages.length) {
delete app.content.subPackages
}
return [app, project]
}
import navigateTo from 'uni-helpers/navigate-to'
import redirectTo from '../../../mp-weixin/helpers/redirect-to'
import previewImage from '../../../mp-weixin/helpers/normalize-preview-image'
import getSystemInfo from '../../../mp-weixin/helpers/system-info'
import getUserProfile from '../../../mp-weixin/helpers/get-user-profile'
// import navigateTo from 'uni-helpers/navigate-to'
// import redirectTo from '../../../mp-weixin/helpers/redirect-to'
// import previewImage from '../../../mp-weixin/helpers/normalize-preview-image'
// import getSystemInfo from '../../../mp-weixin/helpers/system-info'
// import getUserProfile from '../../../mp-weixin/helpers/get-user-profile'
// 需要做转换的 API 列表
export const protocols = {
......
......@@ -110,7 +110,7 @@ export default function parseBaseApp (vm, {
initRefs
}) {
initEventChannel()
if (__PLATFORM__ === 'mp-weixin' || __PLATFORM__ === 'mp-qq'|| __PLATFORM__ === 'mp-jd' || __PLATFORM__ === 'mp-toutiao' || __PLATFORM__ ===
if (__PLATFORM__ === 'mp-weixin' || __PLATFORM__ === 'mp-qq' || __PLATFORM__ === 'mp-jd' || __PLATFORM__ === 'mp-toutiao' || __PLATFORM__ ===
'mp-kuaishou' || __PLATFORM__ === 'mp-alipay' || __PLATFORM__ === 'mp-baidu' || __PLATFORM__ === 'mp-lark') {
initScopedSlotsParams()
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册