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

Commit 376d820

Browse files
committed
refactor: get projectDir directly from projectData
1 parent 4a04dbc commit 376d820

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

Diff for: lib/compiler.js

+1-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const { existsSync } = require("fs");
55
const readline = require("readline");
66

77
const { messages } = require("../plugins/WatchStateLoggerPlugin");
8-
const { safeGet } = require("../projectHelpers");
98
const { buildEnvData, getCompilationContext } = require("./utils");
109

1110
let hasBeenInvoked = false;
@@ -38,7 +37,7 @@ exports.runWebpackCompiler = function runWebpackCompiler(config, $projectData, $
3837

3938
console.log(`Running webpack for ${config.platform}...`);
4039

41-
const projectDir = getProjectDir($projectData);
40+
const projectDir = $projectData.projectDir;
4241
const { platform, env } = config;
4342
const envData = buildEnvData($projectData, platform, env);
4443
const envParams = buildEnvCommandLineParams(config, envData, $logger);
@@ -142,12 +141,3 @@ function logSnapshotWarningMessage($logger) {
142141
}
143142
}
144143

145-
function getProjectDir($projectData) {
146-
const projectDir = safeGet($projectData, "projectDir");
147-
if (!projectDir) {
148-
throw new Error("Cannot find project dir in project data!");
149-
}
150-
151-
return projectDir;
152-
}
153-

0 commit comments

Comments
 (0)