Skip to content

Commit

Permalink
fix(alita): 修复window平台下 usingComponents路径错误
Browse files Browse the repository at this point in the history
  • Loading branch information
ykforerlang committed Jan 3, 2020
1 parent 228620d commit efe12c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/extractWxCompFiles/copyPackageWxComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function getRelativeChunks(moduleInfos, dirname) {
for(let i = 0; i < allModuleRes.length; i ++) {
const res = allModuleRes[i]

if (res.includes(`${dirname}/`)) {
if (res.includes(`${dirname}${path.sep}`)) {
moduleInfos[res].chunks.forEach(c => {
chunks.add(c)
})
Expand Down
5 changes: 4 additions & 1 deletion src/extractWxCompFiles/extractJSONFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ function getFinalPath(element, source, module, info, defaultSpecifier, chunk, js
let requireDefault = true
if (source === 'react-native') {
requireAbsolutePath = getCompPath(chunk, source, `WX${element}`)
requireAbsolutePath = path.resolve(configure.inputFullpath, '.' + requireAbsolutePath)//configure.inputFullpath + (requireAbsolutePath .replace(/\\/g, '/'))
jsonRelativeFiles.add(source)
} else if (judgeLibPath(source) && source === getLibPath(source) && getCompPath(chunk, source, element)) {
requireAbsolutePath = getCompPath(chunk, source, element)
requireAbsolutePath = path.resolve(configure.inputFullpath, '.' + requireAbsolutePath)
jsonRelativeFiles.add(source)
} else {
const deepSeekResult = deepSeekPath(element, info.deps[source], defaultSpecifier, chunk)
Expand All @@ -143,7 +145,8 @@ function getFinalPath(element, source, module, info, defaultSpecifier, chunk, js
if (chunk !== '_rn_') {
const subpageDir = chunk.replace('/_rn_', '')
module = module
.replace(configure.inputFullpath, configure.inputFullpath + '/' + subpageDir)
.replace(configure.inputFullpath, configure.inputFullpath + path.sep + subpageDir)

}

let sp = shortPath(requireAbsolutePath, module)
Expand Down

0 comments on commit efe12c1

Please sign in to comment.