angularcli
angularcli
https://www.linkedin.com/in/andreachiarelli
In the beginning...
...nowadays...
Angular 2 isn't one script include like Angular 1.x
Angular 2 is a set of npm packages...
...and a lot of processing:
● Transpiling (translating TypeScript or ES6 into ES5)
● Building (minimization, optimization, source mapping)
● Packaging (creating module bundles for dynamic
loading)
● Running (live reloading, environment definition)
● Testing (unit testing, e2e testing)
A lot of tools...
A lot of processing require a lot of tools:
● Package managers (npm)
● Transpilers (TypeScript, Babel)
● Module bundlers (Webpack, SystemJS)
● Task runners (Gulp, Grunt)
● Scaffolding tools (Yeoman)
● Test runners and frameworks (Karma, Jasmine)
...and a lot of configuration
Setting up our development environment:
● package.json
● tsconfig.json
● typings.json
● systemjs.config.js or webpack.config.js
● tslint.json
● protractor.config.js
● karma.conf.js
All this
before starting to
write
one single line of code
Welcome Angular CLI
A Command Line Interface for managing Angular 2 projects
Welcome Angular CLI
A Command Line Interface for managing Angular 2 projects
angular-cli.json
Building
Building
Targets
Target Processing
development bundling, sourcemaps
production bundling, minification, uglification, tree-shaking
Development Production
ng build
ng build --target=development ng build --target=production
ng build --dev ng build --prod
Building
Environments
angular-cli.json
Building
Environments
environment.staging.ts
Building
Environments
Running tests
Running tests
Unit tests
Running tests
End-to-end tests
References
● https://cli.angular.io/
● https://github.com/angular/angular-cli