Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add additional tips for heap out of memory #4702

Merged
merged 2 commits into from Nov 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/08-troubleshooting.md
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does code-splitting really help? I definitely fully agree with everything else and I would also leave it in here, but it intrigues me as I would not expect it to make a lot of difference for Rollup at the moment.


### 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.