提交 64382337 编写于 作者: Q qiang

fix: 纯 nvue 模式修复 uni_modules 资源拷贝

上级 14400d6f
...@@ -211,9 +211,11 @@ if (process.env.UNI_USING_V3_NATIVE) { ...@@ -211,9 +211,11 @@ if (process.env.UNI_USING_V3_NATIVE) {
if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) { if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
plugins.push(new WebpackUniMPPlugin()) plugins.push(new WebpackUniMPPlugin())
const assetsDir = 'static'
const hybridDir = 'hybrid/html'
const array = [{ const array = [{
from: path.resolve(process.env.UNI_INPUT_DIR, 'static'), from: path.resolve(process.env.UNI_INPUT_DIR, assetsDir),
to: 'static' to: assetsDir
}] }]
// 自动化测试时,不启用androidPrivacy.json // 自动化测试时,不启用androidPrivacy.json
if (!process.env.UNI_AUTOMATOR_WS_ENDPOINT) { if (!process.env.UNI_AUTOMATOR_WS_ENDPOINT) {
...@@ -225,14 +227,27 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) { ...@@ -225,14 +227,27 @@ if (process.env.UNI_USING_NATIVE || process.env.UNI_USING_V3_NATIVE) {
}) })
} }
} }
const hybridHtmlPath = path.resolve(process.env.UNI_INPUT_DIR, 'hybrid/html') const hybridHtmlPath = path.resolve(process.env.UNI_INPUT_DIR, hybridDir)
if (fs.existsSync(hybridHtmlPath)) { if (fs.existsSync(hybridHtmlPath)) {
array.push({ array.push({
from: hybridHtmlPath, from: hybridHtmlPath,
to: 'hybrid/html' to: hybridDir
}) })
} }
global.uniModules.forEach(module => {
const modules = 'uni_modules/'
const assets = modules + module + '/' + assetsDir
const hybrid = modules + module + hybridDir
array.push({
from: path.resolve(process.env.UNI_INPUT_DIR, assets),
to: assets
}, {
from: path.resolve(process.env.UNI_INPUT_DIR, hybrid),
to: hybrid
})
})
if (process.env.UNI_USING_NVUE_COMPILER) { if (process.env.UNI_USING_NVUE_COMPILER) {
array.push({ array.push({
from: path.resolve(getTemplatePath(), 'common'), from: path.resolve(getTemplatePath(), 'common'),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册