From 7307bfa1510583a06cd1befa21e7d16fc987b486 Mon Sep 17 00:00:00 2001 From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Mon, 7 Nov 2022 21:11:35 -0800 Subject: [PATCH] docs: add additional tips for heap out of memory (#4702) --- 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.