@wavemaker/angular-codegen 11.6.2-next.1417103 → 11.6.2-next.1417107

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,23 @@
1
1
  const { spawnSync } = require('child_process');
2
2
  const path = require('path');
3
3
 
4
- const args = process.argv.slice(2);
5
-
4
+ let processArgs = process.argv;
5
+ if (processArgs.findIndex(arg => arg.startsWith('--max-old-space-size')) !== -1) {
6
+ process.env.NODE_OPTIONS = processArgs.pop();
7
+ console.log("Setting node options: ", process.env.NODE_OPTIONS);
8
+ }
9
+ const args = processArgs.slice(2);
6
10
  const ngBuildArgs = ['build', ...args];
7
- console.log("Build params - ", ngBuildArgs);
11
+ console.log("\x1b[33m", "Angular build params: ", ngBuildArgs);
8
12
 
9
13
  //Trigger angular build with the passed params
10
14
  const ngPath = path.resolve(process.cwd(), 'node_modules', '.bin', "ng");
11
- const ngBuildProcess = spawnSync(ngPath, ngBuildArgs, { stdio: 'inherit', shell: true });
15
+ const ngBuildProcess = spawnSync(ngPath, ngBuildArgs, {stdio: 'inherit', shell: true});
12
16
 
13
17
  if (ngBuildProcess.status === 0) {
14
18
  console.log('ng build completed successfully!');
15
19
  } else {
20
+ // TODO: JS heap out of memory error handling
16
21
  console.error('Error during ng build:', ngBuildProcess.error || ngBuildProcess.stderr);
17
22
  process.exit(1);
18
23
  }