find-dupli

show frontend project duplicated node_module, help to find a way to reduce bundle size

Usage no npm install needed!

<script type="module">
  import findDupli from 'https://cdn.skypack.dev/find-dupli';
</script>

README

find-dup

Show the frontend developer duplicated node_module package in your project , help to find a way to reduce bundle size.

usage

first install find-dup into your project development dependencies

npm install find-dupli --save-dev

second put the following script into package.json in your project

{
  scripts: {
    "find-dup": "find-dup -p 4000 -t npm"
    }
  }

then, executing the script

npm run find-dup

last, open http://localhost:port (port default to 4000), to see the result, visiting http://localhost:port/all will show you all the package install from the entry.

Cli arguments

  • --type or -t set the search type, default to npm, you can set it to yarn.
  • --port or -p set the local server port, default to 4000

tips

  • Executing find-dup after npm install and make sure there is package-lock.json in your projects.
  • You should check the dup constantly especially after changing the dependencies of your project.
  • If any duplication was found, that means unnecessary size in your bundles when webpacking your app, find way to remove it should be good for your app performance.
  • Don't mess the denpendencies and devDependencies in your package.json, you should alway know the difference and put every package in the right place.
  • find-dup use the dependencies in the package.json as the search entry, so it's results will be effected by it.