Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

240
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda