• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ngBucharest/webpack-angularjs: A boilerplate to kickstart development using Webp ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ngBucharest/webpack-angularjs

开源软件地址(OpenSource Url):

https://github.com/ngBucharest/webpack-angularjs

开源编程语言(OpenSource Language):

JavaScript 93.1%

开源软件介绍(OpenSource Introduction):

webpack-angularjs

A boilerplate to kickstart development using Webpack, Gulp, AngularJS and ES6. Needs better documentation.

Features

  • 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.

Global dependencies installation

  • Install node
  • npm install -g gulp webpack

Installation of local dependencies

  • Install node dependencies: npm install
  • Install bower dependencies: bower install

You might get an error when installing webdriver

There is a known bug with higher versions of node, where the chromedriver fails to uncompress.

In these cases, you can :

  1. Download the chrome driver from http://chromedriver.storage.googleapis.com/index.html
  2. Manually decompress it
  3. copy the driver to node_modules/protractor/selenium/chromedriver

Details of the bug here : angular/protractor#1005

Workflow

  • Run development server: gulp
  • Build project: gulp build
    • Example: production-type build with development environment variables: gulp build --build-type=production --build-environment=development

Environments and build types

  • Build type: Using --build-type you can specify whether to use development (default) or production build type.
  • Build environment variables: Using --build-environment you can specify whether to use development (default), stage or production environment variables.

Unit tests

  • 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 or gulp 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.

Browser tests

  • 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 or gulp 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



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap