babel (preset-es2015)
eslint (babel-parser)
typescript
tslint
ng-annotate
Usage example:
import {helper} from './utils';
stylus
stylint
Usage example:
import './reset.styl;
jade-html-loader
ng-cache-loader
Importing in JS:
import template from './tpl.pug';
angular.component('foo', {template});
Importing in DOM:
import './dir1/dir2/dir3/dir4/tpl.pug';
div(ng-include="'tpl/dir3/dir4/tpl.pug'")
pug-loader
Add new plugin to webpack config:
new HtmlPlugin({
filename: '404.html',
template: 'pages/error.pug'
})
url-loader
file-loader
Usage in JS:
import img from 'assets/logo.png';
Usage in styles:
.header-logo
background: url('~/assets/logo.png')
Usage in templates:
img(src="assets/logo.png")
Usage in static pages:
img(src=require("assets/logo.png"))
karma
jasmine
test/unit/index.js
test/unit/**/*.js
src/**/*.spec.js
protractor
jasmine
test/e2e/index.js
test/e2e/**/*.js
src/**/*.e2e.js
istanbul
Add your own settings to coverage:check
script in package.json
istanbul check-coverage --statements 100 --branches 75 --functions 75 --lines 75
localhost:9000/report/unit
localhost:9000/report/coverage
Simple express SPA server
npm run serve
Livereload proxy-server (browser-sync)
npm run serve:dev
API mocks server (json-server)
npm run serve:mocks
Selenium server for protractor
npm run serve:webdriver
Incremental build + unit tests
npm run build:dev
npm run test:unit:dev
E2E tests
npm run test:e2e
npm run validate
npm run build
npm run test
Create local version of .env file
mv .env.example .env
For provide some env variables to client build via EnvironmentPlugin,
add variables names to config/build.js
CLIENT_ENV_VARS: ['API_ENDPOINT', 'API_TOKEN']
and values to .env
file:
API_ENDPOINT=https://api.site.com
API_TOKEN=secret
- e2e watch mode
- e2e in travis
- e2e in Sauce Labs
- source-maps for units
- documentation
- HMR (
[email protected]
) -
babel-preset-es2015-webpack
adds tree shaking features, but doesn't works withng-annotate
. - source-maps in production/unit/e2e with (
[email protected]
) -
SystemJS
-
LoaderOptionsPlugin