Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix next success message path #1333

Merged
merged 1 commit into from
Jan 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions packages/engine-rn-next/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,15 @@ const _runWebBrowser = (
return resolve();
});

const getOutputDir = (c: RnvContext) => {
const distDir = getConfigProp(c, c.platform, 'outputDir');
return distDir || `platformBuilds/${c.runtime.appId}_${c.platform}/.next`;
};

export const getExportDir = (c: RnvContext) => {
const outputDir = getConfigProp(c, c.platform, 'exportDir');
const maybeAbsolutePath = outputDir || path.join(getPlatformBuildDir(c)!, 'output');
const exportDir = getConfigProp(c, c.platform, 'exportDir');
const maybeAbsolutePath = exportDir || path.join(getPlatformBuildDir(c)!, 'output');

// if path is absolute, make it relative to project root. Next 14 doesn't seem to like absolute paths
if (path.isAbsolute(maybeAbsolutePath)) {
return path.relative(c.paths.project.dir, maybeAbsolutePath);
}
return maybeAbsolutePath;
};

export const buildWebNext = async (c: RnvContext) => {
Expand All @@ -130,7 +126,7 @@ export const buildWebNext = async (c: RnvContext) => {
...EnvVars.NEXT_BASE(),
},
});
logSuccess(`Your build is located in ${chalk().cyan(getOutputDir(c))} .`);
logSuccess(`Your build is located in ${chalk().cyan(getExportDir(c))} .`);
return true;
};

Expand Down