提交 748502ef 编写于 作者: fxy060608's avatar fxy060608 提交者: xxxxxx

fix(cli): migrate wxcomponents ASAP

(cherry picked from commit ca832a5c)
上级 d5bfd5cd
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 = {
......
......@@ -417,6 +417,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')
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册