MMR
MMR

Reputation: 3009

How to build an angular2 mobile app without node modules

I have an angular2 app that need to be in mobile app but due to the node modules the app is getting to a huge size of 320mb. Is it possible to build app without node modules.

Upvotes: 0

Views: 88

Answers (1)

Kunso Solutions
Kunso Solutions

Reputation: 7630

node_modules - is libraries which help you to develop application. There are two kind of dependencies: DevDependencies and Dependencies.

In your case you are talking about reducing size of finished client side application. So you first thing you need to do - is to properly bundle your code (Minify, concat and so on), it will greatly reduce the size of your app.

But if it will not be enough for you, you can try to get rid of all third party libs, and keep only angular2 core libraries.

P.S. you are talking about 320mbs. It is incredibly big size of application, I am sure you are talking about both types of dependencies, because front-end part can't be so large.

Pay attention to Building tools like Gulp or Webpack. I suggest you need to take some boilerplate with existing production bundling, so you will better understand how it is usually heppenes in real world examples. Here is nice start point - angular2 seed

Upvotes: 1

Related Questions