diff --git a/README.md b/README.md index f198fac..a569a12 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ and pairing with smart people at Hashrocket. For a steady stream of TILs, [sign up for my newsletter](https://tinyletter.com/jbranchaud). -_915 TILs and counting..._ +_916 TILs and counting..._ --- @@ -1045,6 +1045,7 @@ _915 TILs and counting..._ - [Import A Github Project Into CodeSandbox](workflow/import-a-github-project-into-codesandbox.md) - [Interactively Kill A Process With fkill](workflow/interactively-kill-a-process-with-fkill.md) - [Open Slack's Keyboard Shortcuts Reference Panel](workflow/open-slacks-keyboard-shortcuts-reference-panel.md) +- [Prune The Excess From node_modules](workflow/prune-the-excess-from-node-modules.md) - [Rotate An Image To Be Oriented Upright](workflow/rotate-an-image-to-be-oriented-upright.md) - [Set Recurring Reminders In Slack](workflow/set-recurring-reminders-in-slack.md) - [Toggle Between Stories In Storybook](workflow/toggle-between-stories-in-storybook.md) diff --git a/workflow/prune-the-excess-from-node-modules.md b/workflow/prune-the-excess-from-node-modules.md new file mode 100644 index 0000000..d93984f --- /dev/null +++ b/workflow/prune-the-excess-from-node-modules.md @@ -0,0 +1,20 @@ +# Prune The Excess From node_modules + +The `node_modules` directory, which is part of every JavaScript project, is +infamously heavy. It is a massive directory of all your project's dependencies +and those dependencies' dependencies. + +The size of `node_modules` can become a problem on CI build servers with +limited disk space. You can significantly reduce the size of `node_modules` by +pruning away all the excess files that aren't needed during builds like +markdown files, typescript source files, etc. + +Include the [`node-prune`](https://github.com/tj/node-prune) binary as part of +your build pipeline to handle this. + +```bash +$ node-prune /path/to/node_modules +``` + +In one instance, I saw a reduction from 400MB to 11MB in the `node_modules` +directory size.