We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 86e1fb1 commit 899097dCopy full SHA for 899097d
lib/mp-compiler/util.js
@@ -31,7 +31,8 @@ function getCompNameAndSrc (context, file) {
31
function getNameByFile (dir) {
32
// const arr = dir.match(/[pages?/components?]\/(.*?)(\/)/)
33
const arr = dir.match(/pages\/(.*?)\//)
34
- if (arr && arr[1]) {
+ // 兼容 win 下的路径格式不统一的问题
35
+ if (path.resolve(arr) && path.resolve(arr[1])) {
36
return arr[1]
37
}
38
return path.parse(dir).name
0 commit comments