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

Commit 2a0ddf1

Browse files
committed
refactor: use webpack context when notifying CLI for changed files
1 parent 7135f5e commit 2a0ddf1

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

lib/compiler.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ const { join, resolve: pathResolve } = require("path");
44
const { existsSync } = require("fs");
55
const readline = require("readline");
66
const { messages } = require("../plugins/WatchStateLoggerPlugin");
7-
const { buildEnvData } = require("./utils");
8-
const { AppDirectoryLocation } = require("./constants");
7+
const { buildEnvData, getCompilationContext } = require("./utils");
98

109
let hasBeenInvoked = false;
1110

@@ -95,7 +94,12 @@ exports.runWebpackCompiler = function runWebpackCompiler(config, $mobileHelper,
9594
}
9695

9796
if (hookArgs.filesToSync && hookArgs.startSyncFilesTimeout) {
98-
hookArgs.filesToSync.push(...message.emittedFiles.map(emittedFile => join($projectData.projectDir, AppDirectoryLocation, emittedFile)));
97+
const compilationContext = getCompilationContext(envData);
98+
hookArgs.filesToSync.push(
99+
...message.emittedFiles.map(
100+
emittedFile => join(compilationContext, emittedFile)
101+
)
102+
);
99103
hookArgs.startSyncFilesTimeout();
100104
}
101105
}

lib/constants.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)