0

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.

4
  • webpack or some other framework. Commented Feb 28, 2019 at 18:32
  • why dont you make a build and then upload to hosting server. Commented Feb 28, 2019 at 18:56
  • which version of angular? Commented Feb 28, 2019 at 19:21
  • Are you moving the node_modules folder? If so, you shouldn't. Everything in the node_modules packed into the files in your dist folder (assuming Angular 6 <=) Commented Feb 28, 2019 at 21:31

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.