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

Commit 4f7a93d

Browse files
committed
refactor: export APP_DIR constant from projectHelpers
1 parent 376d820 commit 4f7a93d

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Diff for: index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const path = require("path");
22
const { existsSync } = require("fs");
33

44
const {
5+
APP_DIR,
56
getPackageJson,
67
getProjectDir,
78
isAngular,
@@ -11,15 +12,15 @@ const {
1112
} = require("./projectHelpers");
1213

1314
const PROJECT_DIR = getProjectDir();
14-
const APP_DIR = path.join(PROJECT_DIR, "app");
15+
const APP_PATH = path.join(PROJECT_DIR, APP_DIR);
1516

1617
Object.assign(exports, require('./plugins'));
1718

1819
if (isAngular({ projectDir: PROJECT_DIR })) {
1920
Object.assign(exports, require('./plugins/angular'));
2021
}
2122

22-
exports.getAotEntryModule = function (appDirectory = APP_DIR) {
23+
exports.getAotEntryModule = function (appDirectory = APP_PATH) {
2324
const entry = getPackageJsonEntry(appDirectory);
2425
const aotEntry = `${entry}.aot.ts`;
2526

@@ -32,7 +33,7 @@ exports.getAotEntryModule = function (appDirectory = APP_DIR) {
3233
return aotEntry;
3334
}
3435

35-
exports.getEntryModule = function (appDirectory = APP_DIR) {
36+
exports.getEntryModule = function (appDirectory = APP_PATH) {
3637
const entry = getPackageJsonEntry(appDirectory);
3738

3839
const tsEntryPath = path.resolve(appDirectory, `${entry}.ts`);

Diff for: projectHelpers.js

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ function getAppResourcesPathFromProjectData(data) {
168168
}
169169

170170
module.exports = {
171+
APP_DIR,
171172
getAppPath,
172173
getAppPathFromProjectData,
173174
getAppResourcesPathFromProjectData,

0 commit comments

Comments
 (0)