From 96a9cd479377f3665e6edd7b25aff90ddf7d1fc7 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Thu, 3 Nov 2022 16:36:28 -0700 Subject: [PATCH] docs: add additional tips for heap out of memory --- docs/08-troubleshooting.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/08-troubleshooting.md b/docs/08-troubleshooting.md index 6f32160ede9..5611aa3e503 100644 --- a/docs/08-troubleshooting.md +++ b/docs/08-troubleshooting.md @@ -114,6 +114,8 @@ node --max-old-space-size=8192 node_modules/rollup/bin/rollup -c increasing `--max-old-space-size` as needed. Note that this number can safely surpass your available physical memory. In that case, Node will start paging memory to disk as needed. +You may reduce memory pressure by introducing code splitting by using dynamic imports, importing just specific modules rather than whole dependencies, disabling sourcemaps, or increasing the size of your swap space. + ### Error: Node tried to load your configuration file as CommonJS even though it is likely an ES module By default, Rollup will use Node's native module mechanism to load your Rollup configuration. That means if you use ES imports and exports in your configuration, you either need to define `"type": "module"` in your `package.json` file or use the `.mjs` extension for your configuration. See also [Configuration Files](guide/en/#configuration-files) and [Caveats when using native Node ES modules](guide/en/#caveats-when-using-native-node-es-modules) for more information.