-
-
Notifications
You must be signed in to change notification settings - Fork 789
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: enormous memory consumption of the dev server (#4148)
* fix: enormous dev server memory consumption * chore: add changeset file * add resolversDynamicImport configuration * make vercel default to true * imporve the changelog * Update .changeset/good-oranges-pretend.md * make code cleaner * a fix and refactor * fix build --------- Co-authored-by: Siddharth Suresh <siddh.suresh@gmail.com> Co-authored-by: Brandon Bayer <b@bayer.ws>
- Loading branch information
1 parent
5166e5e
commit c7ac86b
Showing
7 changed files
with
47 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
--- | ||
"@blitzjs/rpc": patch | ||
--- | ||
|
||
Fixes enormous memory consumption of the dev server by changing the default import strategy to "require" instead of "import" which in webpack causes multiple chunks to be created for each import. | ||
|
||
## Blitz Configuration | ||
|
||
To configure this behaviour, you can add the following to your next.config.js: | ||
|
||
```js | ||
/** | ||
* @type {import('@blitzjs/next').BlitzConfig} | ||
**/ | ||
const config = { | ||
blitz: { | ||
resolversDynamicImport: true, | ||
}, | ||
} | ||
``` | ||
|
||
When `resolversDynamicImport` is set to `true`, the import strategy will be "import" instead of "require". | ||
|
||
### On Vercel | ||
|
||
If you are using Vercel, `resolversDynamicImport` will be set to `true` by default, since it is better for the separate chunks to be create for serverless lambdas. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters