Reputation: 111
I am doing my first angular project and I have to upload it to a Development test server. Problem is that, an Angular project (event in default state) has so many files that it takes a lot of time to upload it.
I investigated and the .gitignore file seems only to be to avoid the commit of the files or folders specified there.
Could you please tell me if there is a way to minimize the number of needed files to upload and install or use them later, in local, in a safe way? Without risks of corrupting the project.
Upvotes: 0
Views: 371
Reputation: 111
As @yarz-tech suggested, the solution was to remove the node_modules each time I upload it. Then, when someone downloads it and wants to work with it again, must execute npm install
. That allows npm to install all the dependencies our project needs, based on what is is specified on the package.json
file, which appears not only for Angular projects, but for Node for example.
Thanks to everyone.
Upvotes: 0
Reputation: 2336
If you are using Angular CLI you can get a production build by doing
npm run -- ng build --prod
in the project directory. This will create a minified, bundled version of your app in the dist
folder, ready for upload. You will then need an http-server running to serve these files.
Upvotes: 1