@wavemaker/angular-codegen 11.0.3-next.23404 → 11.0.3-rc.5185

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,4 +13,4 @@ export const environment = {
13
13
  * This import should be commented out in production mode because it will have a negative impact
14
14
  * on performance if an error is thrown.
15
15
  */
16
- // import 'zone.js/dist/zone-error'; // Included with Angular CLI.
16
+ // import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
@@ -61,7 +61,7 @@ import 'core-js/es6/reflect';
61
61
  /***************************************************************************************************
62
62
  * Zone JS is required by default for Angular itself.
63
63
  */
64
- import 'zone.js/dist/zone'; // Included with Angular CLI.
64
+ import 'zone.js'; // Included with Angular CLI.
65
65
 
66
66
 
67
67
  /***************************************************************************************************
@@ -20,10 +20,13 @@ const { executeSyncCmd, MSG_NG_RUNTIME_LOG, MSG_NG_RUNTIME_SUCCESS } = require(
20
20
  /**
21
21
  * @TODO: This is a temporary workaround to extract deploy-url from 'ngBuildParams', need to be replaced in future.
22
22
  */
23
- const getDeployUrl = (ngBuildParams) => {
23
+ const updateDeployUrl = (ngBuildParams) => {
24
24
  let buildArgs = ngBuildParams.split(' ');
25
25
  const deployParam = buildArgs.find(i => i.startsWith("--deploy-url="));
26
- return deployParam ? deployParam.split("=")[1] : 'ng-bundle/';
26
+ if(!deployParam) {
27
+ buildArgs.push("--deploy-url=ng-bundle/");
28
+ }
29
+ return ngBuildParams = buildArgs.join(" ");
27
30
  };
28
31
 
29
32
  /**
@@ -56,10 +59,10 @@ const buildAngularApp = (args) => {
56
59
  process.exit(err.code || err.pid);
57
60
  }
58
61
 
59
- const deployUrl = getDeployUrl(args.ngBuildParams);
62
+ let ngBuildParams = updateDeployUrl(args.ngBuildParams);
60
63
  const NG_BUILD_MSG = 'NG BUILD MIGHT HAVE FAILED WITH HEAP OUT OF MEMORY, RE-EXECUTE THE BUILD BY INCREASING THE MAX-OLD-SPACE-SIZE ARGUMENT VALUE FOR BUILD.UI.NODE.ARGS PROPERTY IN DEPLOYMENT PROFILE';
61
64
  // Generating the angular build and post build process.
62
- executeSyncCmd('cd ' + args.appTarget + ' && node ' + args.nodeVMArgs + ' ' + './node_modules/@angular/cli/bin/ng build ' + args.ngBuildParams + ' && node build-scripts/post-build.js --deploy-url=' + deployUrl, null, MSG_NG_RUNTIME_LOG, false, NG_BUILD_MSG);
65
+ executeSyncCmd('cd ' + args.appTarget + ' && node ' + args.nodeVMArgs + ' `which npm`' + ' run build -- ' + ngBuildParams, null, MSG_NG_RUNTIME_LOG, false, NG_BUILD_MSG);
63
66
  }
64
67
 
65
68