I am developing a Front-end Application and hosting via Heruko
The Problem is that the slug size is too large when i investigated the issue I find out there is files like
/node_modules
/build
/src
/public
package.json
package-lock.json
tsconfig.json
README.md
The Official document says to use .slugignore file
but the problem is that i need to use src and other files in build process
I have found a solution for that but using this heroku-buildpack-post-build-clean
when i tried it i am able to remove
/src
/public
package.json
package-lock.json
tsconfig.json
README.md
if i remove the
/node_modulesthe Application Just Crash
my scripts inside package.json file
"scripts": {
"heroku-prebuild": "npm install -g serve",
"devstart": "react-scripts start",
"start": "serve -s build",
"build": "react-scripts build"
},
now the file size is 465MB
can anyone knows how to safely remove /node_modules or how to better Do it.
the /node_modules size is larger than 410MB
Thanks in Advance



