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(cli): skip printing source maps when exporting #19710

Merged
merged 3 commits into from Oct 27, 2022

Conversation

EvanBacon
Copy link
Contributor

Why

When the source maps aren't written to disk, we shouldn't print them in the console.

How

Test Plan

  • npx expo export --dump-sourcemap -> source maps are printed:
Bundle                     Size
┌ index.ios.js           867 kB
├ index.android.js       870 kB
├ index.ios.js.map      3.58 MB
└ index.android.js.map   3.6 MB
  • npx expo export -> source maps are skipped:
Bundle                Size
┌ index.ios.js      867 kB
└ index.android.js  870 kB
  • npx expo export --platform android -> formats a single-line output:
Bundle  Size
─ foo    3 B

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Oct 26, 2022
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Oct 26, 2022
@@ -42,7 +42,8 @@ export function printBundleSizes(bundles: Partial<Record<Platform, BundleOutput>

export function createFilesTable(files: [string, string | Uint8Array][]): string {
const tableData = files.map((item, index) => {
const fileBranch = index === 0 ? '┌' : index === files.length - 1 ? '└' : '├';
const fileBranch =
index === 0 ? (files.length > 1 ? '┌' : '─') : index === files.length - 1 ? '└' : '├';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like some alien language 😂

@EvanBacon EvanBacon merged commit e330c21 into main Oct 27, 2022
@EvanBacon EvanBacon deleted the @evanbacon/cli/skip-source-map-printing branch October 27, 2022 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants