A boilerplate to kickstart development using Webpack, Gulp, AngularJS and ES6. Needs better documentation.
- Gulp and Webpack as a build system.
- Superstatic, webpack-dev-server and BrowserSync for development.
- ES6 via babel and register.js, with ESLint.
- SASS with Bootstrap and Bourbon.
- Support for jQuery, Modernizr.
- Support for lazy loading via ocLazyLoad and webpack's code splitting mechanism.
- Modular code structure inspired by Google's recommendations.
- Unit tests with support for Bamboo and code coverage via Istanbul.
- E2E tests, local and remote (SauceLabs), with support for Bamboo.
See this presentation for the background: Towards AngularJS 2, with Webpack and ES6.
- Install node
- npm install -g gulp webpack
- Install node dependencies:
npm install
- Install bower dependencies:
bower install
There is a known bug with higher versions of node, where the chromedriver fails to uncompress.
In these cases, you can :
- Download the chrome driver from http://chromedriver.storage.googleapis.com/index.html
- Manually decompress it
- copy the driver to
node_modules/protractor/selenium/chromedriver
Details of the bug here : angular/protractor#1005
- Run development server:
gulp
- Build project:
gulp build
- Example: production-type build with development environment variables:
gulp build --build-type=production --build-environment=development
- Example: production-type build with development environment variables:
- Build type: Using
--build-type
you can specify whether to usedevelopment
(default) orproduction
build type. - Build environment variables: Using
--build-environment
you can specify whether to usedevelopment
(default),stage
orproduction
environment variables.
- Tests are written using Mocha, Chai and Sinon (in
tests/unit
). - They are ran by Karma.
- Run
gulp test --type=unit
for one round of tests orgulp test --type=unit --watch
for continuous testing. - Add the
--bamboo
option if the tests are ran for Bamboo (will create mocha.json). - They will generate coverage reports in the
coverage
directory.
- Tests are written as features using Mocha, Chai and Sinon (in
tests/{folder}
). - They are run by Protractor.
- Run
gulp test --type={folder}
for local testing orgulp test --type={folder} --where=remote
for remote testing using SauceLabs. - Add the
--bamboo
option if the tests are ran for Bamboo (will create mocha.json).
Testing using SauceLabs needs credentials to be set via the shell.
Bash
export SAUCE_USERNAME=username
export SAUCE_ACCESS_KEY=foo-bar-baz
Fish
set -x SAUCE_USERNAME username
set -x SAUCE_ACCESS_KEY foo-bar-baz