2

Can we manage dependencies (js/css), minify, build, serve, watch ... only with node and nmp. If so how it works and why people use grunt, gulp, bower with npm ?

user2080105
  • 1,642
  • 4
  • 18
  • 27

2 Answers2

2

Basically on what i understand (angular-cli is very recent) it hide the webpack .. in reality it use it behind the scene ... i prefer to use the stack made by myself with Webpack and npm .. but now they've just released a new feature the AOT compiler.

https://angular.io/docs/ts/latest/cookbook/aot-compiler.html

In reallity it is possible to be done also with webpack .. but you need some changes of your code :

https://github.com/blacksonic/angular2-aot-webpack

Angular-cli is taken (as idea) from Ember-cli .. it help you to manage and create (scaffold) your app....

I think (but it's my idea) I'll continue without it and I'll try to implement new features (as AOT) by myself cause i want to know what happen behind the scene and know everything of my stack.... but it's my personal idea

Hope it help you ..

federico scamuzzi
  • 3,708
  • 1
  • 17
  • 24
0

Can we manage dependencies (js/css), minify, build, serve, watch ... only with node and npm.

  • the "pm" in "npm" stands for "package-manager" so, of course you can use it as your main package manager.

  • You can define your own npm scripts in the package.json file and they'll get run when you enter arbitrary command in the console (npm run {script-name}). It can - in some way - replace grunt, gulp and other task-runners.

why people use grunt, gulp, bower with npm ?

Good question, in fact it's like using a framework, when using gulp, grunt, etc, you have a single API, and you can easily find ready-made tools that fit your needs and save your time instead of writing your own script every time.

Using these tools also allow to use a unified API to run all your tasks and avoid you messing with several scripts, and question such as "how should I pass arguments to this script ?" "what is the command to run this ?" etc.

For bower vs npm there is already an answer here

Community
  • 1
  • 1
n00dl3
  • 21,213
  • 7
  • 66
  • 76