this project was generated by generator-gulp-angular
- nodejs
- mongodb
- npm install
- bower install
yo gulp-angular --help or yo gulp-angular -h for help. All options are not required. If not provided, default values will be used.
--app-path='src'customize Angular's app folder, relative to cwd, default issrc--dist-path='dist'customize build target folder, relative to cwd, default isdist--e2e-path='e2e'customize e2e test specs folder, relative to cwd, default ise2e--tmp-path='.tmp'customize pre-processing temp folder, relative to cwd, default is.tmp--skip-installdo not runbower installandnpm installafter generating the app, default isfalse(not skip)--skip-welcome-messageskip yo welcome messages, default isfalse(not skip)--skip-messageskip install messages, default isfalse(not skip)--defaultuse default configurations, default isfalse--advancedprompt for advanced additional features, default isfalse
Paths configuration are stored in gulpfile.js. Change options.(src|dist|tmp|e2e) in gulpfile.js if you want to config paths after the app is generated.
Warning: The paths are also written in the index.html for the build with useref. If you want to change these paths, you also have to change the paths there in order to have the build task working.
gulporgulp buildto build an optimized version of your application in/distgulp serveto launch a browser sync server on your source filesgulp serve:distto launch a server on your optimized applicationgulp testto launch your unit tests with Karmagulp test:autoto launch your unit tests with Karma in watch modegulp protractorto launch your e2e tests with Protractorgulp protractor:distto launch your e2e tests with Protractor on the dist files
Best Practice Recommendations for Angular App Structure
The root directory generated with default paths configuration for application with name gulpAngular:
├── bower_components/ ├── e2e/ ├── gulp/ ├── nodes_modules/ │ ├── src/ │ ├── app/ │ │ ├── components/ │ │ │ └── githubContributor/ │ │ │ │ └── githubContributor.service.js │ │ │ │ │ │ │ └── malarkey/ │ │ │ │ ├── malarkey.directive.js │ │ │ │ └── malarkey.(scss|styl|less|css) │ │ │ │ │ │ │ └── navbar/ │ │ │ │ ├── navbar.directive.(js|ts|coffee) │ │ │ │ ├── navbar.html │ │ │ │ └── navbar.(scss|styl|less|css) │ │ │ │ │ │ │ └── webDevTec/ │ │ │ └── webDevTec.service.js │ │ │ │ │ ├── main/ │ │ │ ├── main.controller.(js|ts|coffee) │ │ │ ├── main.controller.spec.js │ │ │ └── main.html │ │ │ │ │ └── index.config.(js|ts|coffee) │ │ └── index.constants.(js|ts|coffee) │ │ └── index.module.(js|ts|coffee) │ │ └── index.route.(js|ts|coffee) │ │ └── index.run.(js|ts|coffee) │ │ └── index.(scss|styl|less|css) | | │ ├── assets/ │ │ └── images/ │ ├── favico.ico │ └── index.html │ ├── .bowerrc ├── .editorconfig ├── .gitignore ├── .eslintrc ├── bower.json ├── gulpfile.js ├── karma.conf.js ├── package.json └── protractor.conf.js
There is none at the generation but you can add .jade, .haml or .hbs (dependent of your HTML pre-processor choice) anywhere in the src folder and it will be compiled automatically. Warning, the first file of a type in a folder is often missed by the Gulp watch, try to relaunch Gulp if it happens.
- 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
- autoprefixer : add vendor prefixes to CSS
- rev : add a hash in the file names to prevent browser cache problems
- watch : watch your source files and recompile them automatically
- eslint : The pluggable linting utility for JavaScript
- 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