gulp
orgulp build
to build an optimized version of your application in/dist
gulp serve
to launch a browser sync server on your source filesgulp serve:dist
to launch a server on your optimized applicationgulp test
to launch your unit tests with Karmagulp test:auto
to launch your unit tests with Karma in watch modegulp protractor
to launch your e2e tests with Protractorgulp protractor:dist
to launch your e2e tests with Protractor on the dist files
More information on the gulp tasks in this README.md.
Best Practice Recommendations for Angular App Structure
The root directory generated for a app with name gulpAngular
:
├── src/ │ ├── app/ │ │ ├── components/ │ │ │ └── navbar/ │ │ │ │ ├── navbar.controller.js │ │ │ │ └── navbar.html │ │ ├── main/ │ │ │ ├── main.controller.js │ │ │ ├── main.controller.spec.js │ │ │ └── main.html │ │ └── index.js │ │ └── index.(css|less|scss) │ │ └── vendor.(css|less|scss) │ ├── assets/ │ │ └── images/ │ ├── 404.html │ ├── favico.ico │ └── index.html ├── gulp/ ├── e2e/ ├── bower_components/ ├── nodes_modules/ ├── .bowerrc ├── .editorconfig ├── .gitignore ├── .jshintrc ├── bower.json ├── gulpfile.js ├── karma.conf.js ├── package.json ├── protractor.conf.js
- useref : allow configuration of your files in comments of your HTML file
- ngAnnotate : convert simple injection to complete syntax to be minification proof
- uglify : optimize all your JavaScript
- csso : optimize all your CSS
- rev : add a hash in the file names to prevent browser cache problems
- watch : watch your source files and recompile them automatically
- jshint : JavaScript code linter
- imagemin : all your images will be optimized at build
- Unit test (karma) : out of the box unit test configuration with karma
- e2e test (protractor) : out of the box e2e test configuration with protractor
- browser sync : full-featured development web server with livereload and devices sync
- angular-templatecache : all HTML partials will be converted to JS to be bundled in the application
- TODO lazy : don't process files which haven't changed when possible