Home > front end >  can i delete the .angular cache webpack subfolders?
can i delete the .angular cache webpack subfolders?

Time:01-06

I am looking through the code for my website (built by another developer). I want to remove all unnecessary code for effeciency and cybersecurity.

Inside the .angular cache folder I've come across angular-webpack and babel-webpack folders.

Angular webpack contains index.pack files (have no clue what these are) babel webpack contains JSON files

Looking online it seems these are just cache files. If I went ahead and just deleted the contents would my website still deploy safely without crashing? or are there other risks to consider?

Appreciate your advice

CodePudding user response:

As you pointed out, those are just caches. They can be deleted without any problem, angular will just rebuild them if they aren't available...

Usually those caches are not commited to version control. They are there to make rebuilds faster while developping. So to talk about efficiency, well those files make things faster in development, but they are not at all used in production bundles.

As for deployment, you should be deploying the dist folder, nothing more is needed.

Now for your cybersecurity concerns. If your server is serving those files, you have a bigger problem at hand I think. You should be only serving the files in the distribution bundle created by Angular. Deleting them will not help anything if your webserver is badly configured.

  • Related