Project was generated with Yeoman generator generator-angular-webpack
- NodeJS v4.0 or newer
- npm v3.3 or newer
- gulp (read Getting Started guide)
- Skip this step if you have generated the project with Yeoman. Yeoman install all dependencies for you.
- To install all development dependencies of existing project run
npm install
inside the root directory of the project.
src : source code
test : unit and e2e test scripts
website : built page (do not edit files there)
assets : don't place assets here. Add assets to /website/assets/ folder.
data : json files preloaded with preloadjs
scripts : app - angular app
data - json files required with webpack
utilities - app classes and objects
main.js - main app file
scss : assets - styles preloaded with preloadjs (for inline images)
edit _assets.scss
use just for a small icons (no big images)
modules - scss modules
_base - default styling
_fonts - page fonts
_shared - scss variables and mixins shared in all scss files
style - main style file
tpls : html templates
assets : media files (images, sprites, video, audio ...)
gulp build : build for development
gulp watch : watch for changes and rebuild updated file
gulp : default task runs 'gulp watch'
gulp build --dist : build for production
gulp browser-sync : create http server for testing
gulp data : build json data from 'src/data/' directory
gulp bump --major : bump major version
gulp bump --minor : bump minor version
gulp bump --patch : bump patch version
- Install libraries with npm.
- If new installed library doesn't work properly with webpack read more about shimming modules here.
- If you want to install library not published in npm but with
package.json
inside git repository you can install package from git repository. Read here how to install it. - If you want to install library not published in npm and without
package.json
you can install it from git repository withnapa
. - To install new library add it to
package.json
file tonapa
variable and runnpm install
. More details how to usenapa
can be found here. - Probably you will need to set
resolve.alias
andloaders
insidewebpack.config.js
for libraries not published in npm.
- To configure modernizr change its settings inside
modernizr-config.json
. - List of all available settings: show
- To set autoprefixer for CSS set
AUTO_PREFIXER_RULES
variable insidegulpfile.js
. - Default value:
['last 2 versions']
. - List of available values: show
root : List of files to copy to website root folder
scssIncludePaths : Array of sass libraries
cssVendor : Array of css libraries installed with npm
To hide build version info set renderVersionInfo
to false
inside src/scripts/utilities/appSettings.js
file.
To bump version use gulp task gulp bump --major | --minor | --patch
Run unit tests with karma start
or e2e tests with protractor
Use linter in your text editor for JavaScript, SCSS and HTML.
- For JavaScript use ESLint. The project contains ESLint configuration
file
.eslintrc
- Use ESLint version 2.x.x
- ESLint for Atom - show
- ESLint for Sublime Text - show
- For SCSS use SCSS-Lint. The project contains SCSS-Lint
configuration file
.scss-lint.yml
- SCSS-Lint for Atom - show
- SCSS-Lint for Sublime Text - show
- For HTML use HTMLHint. The project contains HTMLHint
configuration file
.htmlhintrc
- HTMLHint for Atom - show
- HTMLHint for Sublime Text - show
Mixin library for Sass. Check Bourbon homepage for more details and documentation.
Do not use Bourbon mixins for Vendor Prefixes! SCSS build uses autoprefixer
for them.
Examples:
HiDPI Media Query:
@include hidpi(1.5) {
width: 20em;
}
Font Face:
@include font-face('generica', '../assets/fonts/generica', $file-formats: eot woff ttf svg);
Retina Image:
@retina-image($filename, $background-size, $extension*, $retina-filename*, $retina-suffix*, $asset-pipeline*)
Argument Defaults:
$extension: png
$retina-filename: null
$retina-suffix: _2x
$asset-pipeline: false
Grid framework for Sass and Bourbon. Check Neat homepage for more details and documentation.
Examples: here
@include retina-inline-asset($name, $ext: 'png')
Mixin for generating css with background image encoded in base64 for non-retina and retina screens.
Use this mixin only in `/src/scss/assets/_assets.scss` and only for small icons and logos.