I created a project using the Angular2 quickstart https://angular.io/docs/js/latest/quickstart.html
I changed it completely to do my things, some usage of webcams, indexedDB and things like that :-).
The thing right now is that I've been using npm as the site recommends and it feels wrong now just changing to Gulp to create a build, instead of creating a build script on npm.
The next issue is that I've never done such a thing and I'm completely lost... do you know of any build script I could use/adapt? Or should I switch to Gulp?
Thank you
ng-cli provides a easier way to build angular2 based apps. Npm provides modules for your application (like bootstrap, primeng etc.) Angular-cli is really just a swiss army knife for angular developers.
ng build command compiles the Angular app into an output directory named dist/ at the given output path. This command must be executed from within the working directory. The application builder in Angular uses the webpack build tool, with configuration options specified in the workspace configuration file (angular.
I see, now I think I understand where the misunderstanding is. The link you provided is for Angular2 using Javascript. The best way to create a production Angular2 build is to use Typescript (and I believe it's the only officially supported way at this point as well). Here is a link to the tutorial using Typescript. If you don't know what that is, here's a SO question on it.
Once you learn how to use Angular2 with Typescript, I recommend reading this article on Angular2 in production.
Also, they are currently working on a command-line interface that will automatically build your app for production. They've released it but it's buggy at this point.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With