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

fix(cli): migrate wxcomponents ASAP

上级 4c3f5d75
const fs = require('fs')
const path = require('path')
const {
......@@ -82,27 +81,6 @@ module.exports = (api, options) => {
return chainWebpack(webpackConfig, options)
})
})
if (
process.env.UNI_PLATFORM === 'h5' ||
(
process.env.UNI_PLATFORM === 'app-plus' &&
process.env.UNI_USING_V3
)
) {
const migrate = require('@dcloudio/uni-migration')
const wxcomponentDirs = [path.resolve(process.env.UNI_INPUT_DIR, 'wxcomponents')]
global.uniModules.forEach(module => {
wxcomponentDirs.push(path.resolve(process.env.UNI_INPUT_DIR, 'uni_modules', module, 'wxcomponents'))
})
wxcomponentDirs.forEach(wxcomponentsDir => {
if (fs.existsSync(wxcomponentsDir)) { // 转换 mp-weixin 小程序组件
migrate(wxcomponentsDir, false, {
silent: true // 不输出日志
})
}
})
}
}
module.exports.defaultModes = {
......
......@@ -421,6 +421,27 @@ global.uniPlugin.configureEnv.forEach(configureEnv => {
configureEnv()
})
if (
process.env.UNI_PLATFORM === 'h5' ||
(
process.env.UNI_PLATFORM === 'app-plus' &&
process.env.UNI_USING_V3
)
) {
const migrate = require('@dcloudio/uni-migration')
const wxcomponentDirs = [path.resolve(process.env.UNI_INPUT_DIR, 'wxcomponents')]
global.uniModules.forEach(module => {
wxcomponentDirs.push(path.resolve(process.env.UNI_INPUT_DIR, 'uni_modules', module, 'wxcomponents'))
})
wxcomponentDirs.forEach(wxcomponentsDir => {
if (fs.existsSync(wxcomponentsDir)) { // 转换 mp-weixin 小程序组件
migrate(wxcomponentsDir, false, {
silent: true // 不输出日志
})
}
})
}
if (process.env.UNI_PLATFORM.startsWith('mp-')) {
console.log('小程序各家浏览器内核及自定义组件实现机制存在差异,可能存在样式布局兼容问题,参考:https://uniapp.dcloud.io/matter?id=mp')
}
......@@ -429,4 +450,4 @@ runByHBuilderX && console.log('正在编译中...')
module.exports = {
manifestPlatformOptions: platformOptions
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册