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

fix(vue2): 修复 非根目录、分包目录 的 static 目录资源引用 (question#190650)

上级 e4fb0fec
......@@ -18,8 +18,9 @@ module.exports = {
if (resourcePath.startsWith(inputDir)) {
const relativePath = normalizePath(path.relative(inputDir,
resourcePath))
if (relativePath.startsWith('static/') || relativePath.includes(
'/static/')) {
const subPackageStatic = Object.keys(process.UNI_SUBPACKAGES || {}).map(root => normalizePath(path.join(root,
'static')) + '/')
if (relativePath.startsWith('static/') || subPackageStatic.some(s => relativePath.startsWith(s))) {
return relativePath
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册