Skip to content

Commit 0b88b47

Browse files
committed
fix: 嵌套 node_modules 的情况
1 parent aa2a410 commit 0b88b47

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/mp-compiler/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function genComponentWxml (compiled, options, emitFile, emitError, emitWarning)
5050
function createAppWxml (emitFile, resourcePath, rootComponent, context) {
5151
const { src } = getFileInfo(resourcePath) || {}
5252
const { name: componentName, filePath: wxmlSrc } = getCompNameAndSrc(context, rootComponent)
53-
const wxmlContent = genPageWxml(componentName, `${wxmlSrc}`)
53+
const wxmlContent = genPageWxml(componentName, wxmlSrc)
5454
emitFile(`${src}.wxml`, wxmlContent)
5555
}
5656
// 更新全局组件时,需要重新生成wxml,用这个字段保存所有需要更新的页面及其参数

lib/utils/resolve-src.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ const upath = require('upath')
33

44
// 获取文件路径,去掉 src 和 node_modules 目录
55
module.exports = function (...arv) {
6-
return upath.normalize(relative(...arv)).replace(/^src\//, '').replace(/^node_modules\//, 'modules')
6+
return upath.normalize(relative(...arv)).replace(/^src\//, '').replace(/node_modules\//g, 'modules/')
77
}

0 commit comments

Comments
 (0)