Skip to content

fix: set minify to false #117

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

Merged
merged 3 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ All command-line arguments are optional. By default a production build will be c
| `only-mapped` | Exclude "unmapped" bytes from the output (default is **false**). This will result in total counts less than the file size. | `--only-mapped` |
| `verbose` | Dumps additional output to the console (default is **false**) | `--verbose` |
| `reset-cache` | Removes cached react-native files (default is **false**) | `--reset-cache` |
| `--expo` | Set this to true/ false based on whether using expo or not. For eg, set `--expo true` when using expo. Not required to pass this for react-native cli. (default is **false**) | `--expo false` |

[smeo]: https://github.com/danvk/source-map-explorer#options

> The `--expo` command is no longer needed for Expo SDK 41 or higher; and has been removed. Use [react-native-bundle-visualizer@2](https://github.com/IjzerenHein/react-native-bundle-visualizer/tree/v2) when targetting Expo SDK 40 or lower.
>Use [react-native-bundle-visualizer@2](https://github.com/IjzerenHein/react-native-bundle-visualizer/tree/v2) when targetting Expo SDK 40 or lower.

## Version compatibility

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
"scripts": {
"test": "yarn test:rn && yarn test:expo",
"test:rn": "cd test/RN64 && yarn install && npx ../.. && cd ../..",
"test:expo": "cd test/Expo42 && yarn install && npx ../.. && cd ../.."
"test:expo": "cd test/Expo42 && yarn install && npx ../.. --expo=true && cd ../.."
}
}
18 changes: 7 additions & 11 deletions src/react-native-bundle-visualizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const tmpDir = path.join(baseDir, getAppName());
const outDir = path.join(tmpDir, 'output');
const entryFile = argv['entry-file'] || getEntryPoint();
const platform = argv.platform || 'ios';
const expoTargetDeprecated = argv.expo || '';
const isExpo = argv.expo || false;
const dev = argv.dev || false;
const verbose = argv.verbose || false;
const resetCache = argv['reset-cache'] || false;
Expand Down Expand Up @@ -95,21 +95,14 @@ const commands = [
bundleOutput,
'--sourcemap-output',
bundleOutputSourceMap,
'--minify',
isExpo
];
if (resetCache) {
commands.push('--reset-cache');
commands.push(resetCache);
}

// Warn about `--expo` deprecation
if (expoTargetDeprecated) {
console.error(
chalk.red.bold(
'The "--expo" command is no longer needed for Expo SDK 41 or higher. When using Expo SDK 40 or lower, please use `react-native-bundle-visualizer@2`.'
)
);
}

const reactNativeBin = getReactNativeBin();
const bundlePromise = execa(reactNativeBin, commands);
bundlePromise.stdout.pipe(process.stdout);
Expand Down Expand Up @@ -188,4 +181,7 @@ bundlePromise

// Open output file
return open(bundleOutputExplorerFile);
});
}).catch(error => console.log(
chalk.red('=== error ==='),
error
));