Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

[xdl] fix expo export --dump-sourcemap for sdk 40+ and bare projects #3095

Merged
merged 2 commits into from
Jan 25, 2021
Merged
Changes from 1 commit
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: 8 additions & 4 deletions packages/xdl/src/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,14 @@ export async function exportForAppHosting(
const androidMapPath = path.join(outputDir, 'bundles', androidMapName);
await writeArtifactSafelyAsync(projectRoot, null, androidMapPath, androidSourceMap);

// Remove original mapping to incorrect sourcemap paths
logger.global.info('Configuring sourcemaps');
await truncateLastNLines(iosJsPath, 1);
await truncateLastNLines(androidJsPath, 1);
if (!(target === 'bare' && semver.lte('40.0.0', exp.sdkVersion))) {
esamelson marked this conversation as resolved.
Show resolved Hide resolved
esamelson marked this conversation as resolved.
Show resolved Hide resolved
// Remove original mapping to incorrect sourcemap paths
// In SDK 40+ bare projects, we no longer need to do this. It's also possible we should no
// longer do this in managed projects and/or older SDK versions, but this is safest for now
logger.global.info('Configuring sourcemaps');
esamelson marked this conversation as resolved.
Show resolved Hide resolved
await truncateLastNLines(iosJsPath, 1);
await truncateLastNLines(androidJsPath, 1);
}

// Add correct mapping to sourcemap paths
await fs.appendFile(iosJsPath, `\n//# sourceMappingURL=${iosMapName}`);
Expand Down