Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
Optimize angular bundle size on WordPress site

I have a site that is based on WordPress with an integration of Angular (version 13). FYI, to be able to use Angular on php files (specific to WordPress) I had to create Custom Elements for each Component of my Angular app.

The site does not get a very good score on PageSpeed ​​Insights on mobile (26) while on Desktop the score is 89. According to the results, the main cause of this bad score would be the files produced by Angular (css and js). These files produced by Angular are the result of a set of tasks performed during compilation. Here is the list of files:

  • angular.js which is a concatenation of the runtime.js, polyfills.js, scripts.js and main.js files produced by the ng build command. These files are concatenated using a js script that uses the "concat" package
  • vendor.js which is a concatenation of js files from third-party libraries (jquery.min.js, jquery-match-height.js, jquery.columnizer.js, jquery.scrollTo.min.js, select2.min.js, stellarnav.min.js) and other handwritten js files. Also concatenated with a js script that uses the "concat" package
  • styles.css which is a concatenation and minification of the css file produced by ng build and other css files. Using "concat" and "csso" package in the js script

Here is the size of the files:

    angular.js --> 2.3MB
    vendor.js --> 83.4 kB
    styles.css --> 157 kB

So how to reduce the weight of the angular.js file? (according to my browser console the file is indeed gzipped)

A solution might be to use the Lazy Load modules, but can I do it on such an application (not using Angular routing)?

Thank you in advance for your help !

Best regards, Killian

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!