mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-04 08:15:41 +00:00
fix: keep the Docker build within Node's default heap #1510
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import config from '../../next.config';
|
||||
|
||||
describe('webpack build worker', () => {
|
||||
// Next turns the workers off for a config with a webpack hook unless the
|
||||
// option is set, and the Docker build then runs out of heap (#1510).
|
||||
it('stays on although next-intl adds a webpack hook', () => {
|
||||
expect(config.webpack).toBeTypeOf('function');
|
||||
expect(config.experimental?.webpackBuildWorker).toBe(true);
|
||||
});
|
||||
});
|
||||
@@ -102,6 +102,13 @@ const nextConfig: NextConfig = {
|
||||
typescript: {
|
||||
tsconfigPath: "tsconfig.build.json",
|
||||
},
|
||||
// next-intl's plugin adds a webpack hook, and with one Next runs the client,
|
||||
// server and edge compilers in its main process on one heap, which outgrew
|
||||
// Node's default limit of about 2.2 GB (#1510). In workers each compiler has
|
||||
// its own heap, freed when it finishes. Turbopack builds don't read this.
|
||||
experimental: {
|
||||
webpackBuildWorker: true,
|
||||
},
|
||||
// No proxyClientMaxBodySize: Next copies every body proxy.ts runs for up to
|
||||
// that size before routing, so it stays at the 10 MB default. The routes
|
||||
// that take bigger uploads (WOPI saves, WebDAV, /api/plugin-proxy) are left
|
||||
|
||||
Reference in New Issue
Block a user