Build commands are used for when code is to be compiled to an output that is suitable for a particular environment.
- 1. Building
npm run build:styles
- Compiles sass
- Uses autoprefixer to parse CSS and add vendor prefixes
- Minifies CSS
- Creates two files in
{root}/doc/css/
wmcads-website.min.css
- For styleguide specific styling
wmcads-components.min.css
- For any styling related to WMRE components
- Creates sourcemaps in
{route}/_sourcemaps/
npm run build:templates
- Lint templates
- Compile all handlebar file includes using gulp handlebars file include
- Outputs compiled files to
{route}/doc/views/
npm run build:scripts
- Lints scripts
- Compiles javascript files with babel
- Concatenates all smaller javascript files together into one file
- Mangles and minifies the file
- Creates three files in
{root}/doc/js/
wmcads-website.min.js
- Created from any javascript files found in
{root}/src/wmcads-website/**/*.js
- For styleguide specific items only
- Created from any javascript files found in
vendor.min.js
- Created from any javascript files found in
{root}/src/assets/js/vendor/**/*.js
- For any vendor/third-party scripts that are required for components
- Created from any javascript files found in
WMRE.min.js
- Created from any javascript files found in
['src/assets/js/WMRE.js', 'src/components/**/*.js']
- For any custom javascript associated with a component
- Created from any javascript files found in
- Creates sourcemaps in
{route}/_sourcemaps/
npm run build:images
- Minifies all images located in
{root}/src/assets/img/**/*
- Outputs the minified images to
{root}/doc/img/
with the exact same file name
npm run build:sprites
npm run build:config
- Moves
{root}/src/assets/config/**/*
to{root}/doc/config
npm run build:all
npm run clean
(cleans the directory)npm run build:styles
(build styles)npm run build:templates
(build templates)npm run build:scripts
(build scripts)npm run build:images
(minifies images)npm run build:sprites
(build sprite sheets)npm run build:config
(build config)npm run lint:styles
(lint styles)npm run lint:templates
(lint templates)npm run lint:scripts
(lint scripts)