This is a bundle for Frontend-starter with default directory structure.
Before start you need:
- Bower or npm
- Git, e.g. Github desktop
Install Frontend-starter, then unpack this repo to the desired project location (if you clone, you'd rather want to remove the .git
directory, because as it is just a kind of template, it won't be under version control). Remember not to use a directory containing an exclamation mark (!) - it breaks glob patterns used by the tasks.
-
Bower
Run:
bower install
On Windows, remember to run Bower from Git Shell. Bower files are by default placed in
bower_components
- to change this, edit the.bowercc
file and changedirs.bower
config definition. -
npm
First, uncomment webpack support in the
frs.config.js
file and move dependencies frombower.json
to thepackage.json
file; changesass-core
tosass-starter
there (the same package, but different name in npm) and insrc/styles/style.scss
.Finally, run:
npm install
Then use the Frontend-starter gulp tasks. For example, for the first init, use:
frs start
To fully customize directory structure and other parameters, see the docs config section.
Font files for font-face generation.
Your images, that will be optimized and saved in the dist directory.
Image sprites, see more in the Sprites section.
All your JavaScript files (including those installed with Bower) are by default concatenated into one file: app.js
. Thanks to this, you don't have to change markup when adding/removing any files or packages.
By default, jQuery@2 is installed.
/vendor/js
contains third-party scripts, that you can't or don't want to install via Bower - they are watched and handled separately and prepended to the app.js
file.
If you want to skip any of the Bower packages, you have 2 options:
- create a comp that uses selected packages, set its
filename
tonull
andexcludeIn
totrue
- use the
overrides
option inbower.json
file or edit configurationconfig.js.mainBowerFiles.overrides
value (see main-bower-files docs).
A simple directory structure for BEM methodology implementation:
style.scss
: contains only imports of included filesmodules
: project-specific config (common variables, fonts, colors) and mixinscomponents
: block styling
By default, the following libraries are included:
- reset-css - provides CSS reset (by Eric Meyer)
- Breakpoint for convenient media queries handling
- SASS-core - mixins and functions such as: automatic rem/vw/percentage unit converters for dimensions and fonts, responsive sprites, grids
If you don't need any of them:
- remove the dependency from the
bower.json
/package.json
file (depending on the package manager you use) - remove import from
styles/style.scss
Place any third-party scripts that you can't or don't want to install via package manager into /vendor/styles
.
Sprites are generated automatically by gulp-spritesmith for all images placed in the /sprites
directory. To use a sprite, use the mixin @include sprite($filename)
. See more in Frontend-starter sprite docs and SASS-core docs.