IjzerenHein / react-native-bundle-visualizer

See what packages are increasing your react-native bundle size 📦
MIT License
1.46k stars 44 forks source link

Support monorepo #22

Closed brunolemos closed 5 years ago

brunolemos commented 5 years ago

Test project: https://github.com/brunolemos/react-native-web-monorepo

Output:

[16:38:39] brunolemos:react-native-web-monorepo git:(master) $ npx react-native-bundle-visualizer     
npx: installed 77 in 3.994s
Generating bundle...
Error: The resource `/Users/user/projects/react-native-web-monorepo/index.js` was not found.
    at /Users/user/projects/react-native-web-monorepo/node_modules/metro/src/IncrementalBundler.js:157:26
    at gotStat (fs.js:1676:21)
    at callback (/Users/user/projects/react-native-web-monorepo/node_modules/graceful-fs/polyfills.js:295:20)
    at FSReqCallback.oncomplete (fs.js:169:21)
(node:2927) UnhandledPromiseRejectionWarning: Error: Command failed with exit code 1 (EPERM): ./node_modules/.bin/react-native bundle --platform ios --dev false --entry-file ./index.js --bundle-output /var/folders/xh/gcxkb1qx2rd3fmqz5vxrs2lh0000gn/T/react-native-bundle-visualizer/myprojectname/ios.bundle --sourcemap-output /var/folders/xh/gcxkb1qx2rd3fmqz5vxrs2lh0000gn/T/react-native-bundle-visualizer/myprojectname/ios.bundle.map
    at makeError (/Users/user/.npm/_npx/2927/lib/node_modules/react-native-bundle-visualizer/node_modules/execa/lib/error.js:58:11)
    at handlePromise (/Users/user/.npm/_npx/2927/lib/node_modules/react-native-bundle-visualizer/node_modules/execa/index.js:112:26)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2927) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2927) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[16:38:47] brunolemos:react-native-web-monorepo git:(master) $ cd packages/mobile 
[16:39:13] user:mobile git:(master) $ npx react-native-bundle-visualizer
npx: installed 77 in 4.218s
Generating bundle...
Error: The resource `/Users/user/projects/react-native-web-monorepo/index.js` was not found.
    at /Users/user/projects/react-native-web-monorepo/node_modules/metro/src/IncrementalBundler.js:157:26
    at gotStat (fs.js:1676:21)
    at callback (/Users/user/projects/react-native-web-monorepo/node_modules/graceful-fs/polyfills.js:295:20)
    at FSReqCallback.oncomplete (fs.js:169:21)
(node:2952) UnhandledPromiseRejectionWarning: Error: Command failed with exit code 1 (EPERM): ./node_modules/.bin/react-native bundle --platform ios --dev false --entry-file ./index.js --bundle-output /var/folders/xh/gcxkb1qx2rd3fmqz5vxrs2lh0000gn/T/react-native-bundle-visualizer/mobile/ios.bundle --sourcemap-output /var/folders/xh/gcxkb1qx2rd3fmqz5vxrs2lh0000gn/T/react-native-bundle-visualizer/mobile/ios.bundle.map
    at makeError (/Users/user/.npm/_npx/2952/lib/node_modules/react-native-bundle-visualizer/node_modules/execa/lib/error.js:58:11)
    at handlePromise (/Users/user/.npm/_npx/2952/lib/node_modules/react-native-bundle-visualizer/node_modules/execa/index.js:112:26)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
(node:2952) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:2952) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[16:39:20] user:mobile git:(master) $ 
brunolemos commented 5 years ago

npx react-native-bundle-visualizer --entry-file packages/mobile/index.js worked