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

fix(mp): windows path

上级 4170c69d
......@@ -78,8 +78,20 @@ module.exports = function generateComponent (compilation) {
let moduleId = ''
if (name.indexOf('node-modules') === 0) {
const modulePath = removeExt(restoreNodeModules(name))
const resource = normalizePath(path.resolve(process.env.UNI_INPUT_DIR, '..', modulePath))
let resource = normalizePath(path.resolve(process.env.UNI_INPUT_DIR, '..', modulePath))
const altResource = normalizePath(path.resolve(process.env.UNI_INPUT_DIR, modulePath))
if (
/^win/.test(process.platform) &&
modulePath.includes('@dcloudio') &&
(
modulePath.includes('page-meta') ||
modulePath.includes('navigation-bar')
)
) {
resource = normalizePath(path.resolve(process.env.UNI_CLI_CONTEXT, modulePath))
}
moduleId = findComponentModuleId(modules, concatenatedModules, resource, altResource)
} else {
const resource = removeExt(path.resolve(process.env.UNI_INPUT_DIR, name))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册