IjzerenHein / react-native-bundle-visualizer

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

Pass down source-map-explorer arguments. #25

Open wilau2 opened 4 years ago

wilau2 commented 4 years ago

It would be very useful to let the user pass down source-map-explorer client options.

It would make it easier to use this lib as well to run on ci

image

IjzerenHein commented 4 years ago

output and only-mapped are now supported and has been released in https://github.com/IjzerenHein/react-native-bundle-visualizer/releases/tag/v2.2.1

IjzerenHein commented 4 years ago

Could you explain how you use this on CI and which other options would be helpful to also pass through?

wilau2 commented 4 years ago

Hi @IjzerenHein, I ended up using "bundlesize": "0.18.0", where I can pass a size limit:

 "bundlesize": [
    {
      "path": "tmp.bundle",
      "maxSize": "2 mB",
      "compression": "none"
    }
  ],

For it to work, I use "bundle": "react-native bundle --entry-file index.js --bundle-output tmp.bundle --sourcemap-output tmp.map --dev false",