Delete file to make plugin less large

Hello,

I am trying to see if this is possible to delete unused file in my custom plugin to make them less large. Did someone know if there is a trick to know which file are unused.

Thanks’ in advance
Nicolas

@nicolasdossantos248 generally speaking a plugin only needs the plugin.json and module.js files. All the other files offer support for your main file.

You can do several things to reduce the size of your plugin:

  • reduce the external dependencies you use, sometimes you only need one specific thing from a big library that’s not tree shakecable and you end up with all the library bundled.
  • if you are using images, optimize them or use SVG for smaller foot prints
  • Split your file into different entries and lazy-load them using React-lazy and webpack chunk split.
1 Like