Skip to content
This repository was archived by the owner on Aug 7, 2021. It is now read-only.

Commit 875fd3e

Browse files
committed
fix: use relative path for context
1 parent 11aed4d commit 875fd3e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/compiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ exports.runWebpackCompiler = function runWebpackCompiler(config, $mobileHelper,
9797
const compilationContext = getCompilationContext(envData);
9898
hookArgs.filesToSync.push(
9999
...message.emittedFiles.map(
100-
emittedFile => join(compilationContext, emittedFile)
100+
emittedFile => join($projectData.projectDir, compilationContext, emittedFile)
101101
)
102102
);
103103
hookArgs.startSyncFilesTimeout();

lib/utils.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ function buildEnvData(platform, env) {
1313
function getCompilationContext(env) {
1414
const projectDir = getProjectDir();
1515
const config = getWebpackConfig(projectDir, env);
16-
const context = config.context || projectDir;
17-
const absolutePathToContext = path.resolve(context);
16+
const { context } = config;
1817

19-
return absolutePathToContext;
18+
return context ?
19+
path.relative(projectDir, context) :
20+
".";
2021
}
2122

2223
function shouldSnapshot($mobileHelper, config) {

0 commit comments

Comments
 (0)