0

I have an angular5 application, i use webpack bundler and yarn package manager. I setup the application by running the following commands:

yarn global add @angular/cli@latest

yarn

It installs angular-cli, all the respective dependencies/libraries and link the dependencies. When i run ng serve the application works fine, when i run ng build --aot the application builds fine and the build runs perfectly too.

But when i run the same commands to run my build using a Jenkins Job like below it's not updating the vendor bundle correctly because of which some parts of the application is not working right, especially highcharts

yarn global add @angular/cli@latest

yarn

ng build --aot

I even tried ng build --aot --vendor-chunks=true , still the vendor.js and vendor.map.js files in my local build and the one on jenkins build differ.

I did delete all my node_modules , and ran the above mentioned commands, still no difference. The other big difference i could see is my node_modules on local machine have around 1535 packages and the one on jenkins workspace has only 1505. I verified most of the main packages , especially for highcharts & highmaps. They do exist though.

What am i missing here ? Is it a parameter issue or some other install-able is missing. I am using anglar-cli version 1.7.4, yarn 1.6.0 and webpack latest version too.

hakuna
  • 6,243
  • 10
  • 52
  • 77
  • Is there a chance the files are just being cached in your browser? Is there a reason you aren't running `ng build --prod` instead? It would be better to get the cache busting names. https://github.com/angular/angular-cli/wiki/build – Daniel W Strimpel Apr 22 '18 at 00:41
  • No , its not cache. I compared the files side by side and they are different. Also I tried by deleting all the browser history too. Used ng build --prod ,but no difference – hakuna Apr 22 '18 at 14:57

1 Answers1

0

The issue ends up being the angular-highcharts version. Downgrading it from 5.2.12 to 5.2.1 made it working normally.

hakuna
  • 6,243
  • 10
  • 52
  • 77