Question Details

No question body available.

Tags

angular gzip lazy-loading bundle

Answers (4)

July 23, 2025 Score: 0 Rep: 173 Quality: Low Completeness: 40%

I'd recommend you to implement lazy loading to reduce bundle size, also check if your files are gzipped and, if it's not, gzip them.

Also, are you sure all 150 NgModules are needed? Perhaps some could be eliminated without breaking your application.

Check this blog post.

July 23, 2025 Score: 0 Rep: 63 Quality: Low Completeness: 50%

These issues are notoriously difficult to resolve, but I think Karolis is asking the right question. Using the custom webpack causes angular to skip its normal optimizations. You should take a look at the webpack.config.js file to see if something there might be causing the slowdown.

Also please check your tailwind implementation. You have it listed twice in styles, so angular will load it twice. Tailwind can also slow things down if the "tailwind.config.js" file has a content line that scans every file, such as.

content: ["./src//"]

You may want to limit the scanning like this

content: ["./src//.{html,ts}"]

Perhaps this will help. Obviously, can't help with webpack.config.js until you share the contents.

I would start with these things and then dig deeper if they are not the cause.

July 24, 2025 Score: 0 Rep: 339 Quality: Low Completeness: 50%

As I'm unfamiliar with angular, I'm not exactly sure how the angular.js file comes into play here.

But I would try doing this to your webpack.config.js and see if there's any difference:

module.exports = {
    module: {
      rules: [
        {
          test: /\.svg$/,
          use: [ 'raw-loader' ]
        }
      ]
    },
    devtool: 'cheap-module-source-map',
};

Yes, you do have a lot of modules, but I would be looking into how to cache these things so that you have some sort of hot-reload that is more efficient...

July 24, 2025 Score: -1 Rep: 862 Quality: Low Completeness: 0%

I had a similar issue. I could not resolve it.

I started again with a new clean project and moved all components, services, etc. to finally get rid of the problem.