Webpack: cache lib.js to disk to prevent occasional OOM

This commit is contained in:
Cohee
2024-11-28 22:39:20 +02:00
parent afb4acc19b
commit b5c2ecdfcc
2 changed files with 6 additions and 1 deletions

View File

@ -1,4 +1,5 @@
import process from 'node:process';
import fs from 'node:fs';
import webpack from 'webpack';
import middleware from 'webpack-dev-middleware';
import { publicLibConfig } from '../../webpack.config.js';
@ -16,5 +17,8 @@ export default function getWebpackServeMiddleware() {
});
}
return middleware(compiler, {});
return middleware(compiler, {
// @ts-ignore Use actual file system to ease on heap memory usage
outputFileSystem: fs,
});
}