diff --git a/bin/commands/bundle.js b/bin/commands/bundle.js index 379d741..e6c0f91 100644 --- a/bin/commands/bundle.js +++ b/bin/commands/bundle.js @@ -6,10 +6,6 @@ module.exports = { describe: 'Bundles a repository', handler: (args) => { const configPath = resolve(__dirname, '../../config/rspack.config.js'); - call('rspack', `build --c "${configPath}" ${(args.strings || []).join(' ')}`, { - env: { - NODE_OPTIONS: '--max-old-space-size=8192', - }, - }); + call('rspack', `build --c "${configPath}" ${(args.strings || []).join(' ')}`); }, }; diff --git a/bin/commands/utils.js b/bin/commands/utils.js index 7a38c11..5ba9521 100644 --- a/bin/commands/utils.js +++ b/bin/commands/utils.js @@ -31,6 +31,8 @@ const call = (command, args, options = {}) => { stdio: 'inherit', env: { NODE_PATH: nodePath, + // Increase memory limits for node all processes + NODE_OPTIONS: '--max-old-space-size=8192 --max-semi-space-size=512', ...(options.env || {}), ...process.env, }, diff --git a/package.json b/package.json index 9b77f75..ee8a4b0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "visyn_scripts", "description": "", - "version": "15.1.1", + "version": "15.1.2", "author": { "name": "datavisyn GmbH", "email": "contact@datavisyn.io", diff --git a/tests/visyn_scripts.test.js b/tests/visyn_scripts.test.js index 1896d79..7e9aa74 100644 --- a/tests/visyn_scripts.test.js +++ b/tests/visyn_scripts.test.js @@ -50,16 +50,12 @@ describe('cli', () => { it('runs the bundle script in production mode', async () => { // const callSpy = jest.spyOn(utils, "call"); await runCommand('bundle'); - expect(call).toHaveBeenCalledWith(expect.stringMatching(/(?=.*rspack)/), expect.stringMatching(/(?=.*rspack\.config\.js)/), expect.anything()); + expect(call).toHaveBeenCalledWith(expect.stringMatching(/(?=.*rspack)/), expect.stringMatching(/(?=.*rspack\.config\.js)/)); }); it('runs the bundle script in development mode', async () => { // const callSpy = jest.spyOn(utils, "call"); await runCommand('bundle', '--mode', 'development'); - expect(call).toHaveBeenCalledWith( - expect.stringMatching(/(?=.*rspack)/), - expect.stringMatching(/(?=.*--mode development)(?=.*rspack\.config\.js)/), - expect.anything(), - ); + expect(call).toHaveBeenCalledWith(expect.stringMatching(/(?=.*rspack)/), expect.stringMatching(/(?=.*--mode development)(?=.*rspack\.config\.js)/)); }); });