mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Webpack: cache lib.js to disk to prevent occasional OOM
This commit is contained in:
@ -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,
|
||||
});
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ export const publicLibConfig = {
|
||||
hints: false,
|
||||
},
|
||||
output: {
|
||||
path: path.resolve(process.cwd(), 'dist'),
|
||||
filename: 'lib.js',
|
||||
libraryTarget: 'module',
|
||||
},
|
||||
|
Reference in New Issue
Block a user