Skip to content

Commit

Permalink
v7.19.0 — Updated docs image related tasks. (#123)
Browse files Browse the repository at this point in the history
* v7.19.0 — Updated docs image related tasks.

* v7.19.0 — Grammar.

* v7.19.0 — Package version bump.

* v7.19.0 — Wrap conditional array syntax.
  • Loading branch information
DamianMullins authored Apr 11, 2018
1 parent 98223c2 commit f1a5973
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 10 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).


v7.19.0
------------------------------
*April 11, 2018*

### Added
- Added `copy:img:docs` task and documentation.

### Changed
- The `images:optimise` no longer copies images into the docs asset dist folder.
- The `images` task now copies all of the images in the assets dist folder over to the docs dist folder if running a docs task.


v7.18.0
------------------------------
*April 11, 2018*
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,9 @@ Runs the following tasks

- #### `images:svg-sprite`

Generate an SVG sprite and copy into the dist directory
Generate an SVG sprite and copy into the dist directory

It also runs the [`copy:img`](#copyjs-copycss-copyimg--copyfonts) and [`copy:assets`](#copyassets) tasks.

### `service-worker`

Expand Down Expand Up @@ -267,6 +269,10 @@ Pushes the documentation dist directory to the `gh-pages` branch.

Removes document files already in the docs dist directory.

- #### `copy:img:docs`

Copies all of the images in the assets dist folder over to the docs dist folder.

- #### `browser-sync`

Watches for changes to files and reloads a local website instance.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@justeat/gulp-build-fozzie",
"version": "7.18.0",
"version": "7.19.0",
"description": "Gulp build tasks for use across Fozzie modules",
"main": "index.js",
"author": "Damian Mullins <[email protected]> (http://www.damianmullins.com)",
Expand Down
11 changes: 11 additions & 0 deletions tasks/copy.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ gulp.task('copy:img', () => {
copy('img');
});

/**
* `copy:img:docs` Task
* ---------------------
* Copy all of the images in the assets dist folder over to the docs dist folder.
*
*/
gulp.task('copy:img:docs', () => gulp.src(`${pathBuilder.imgDistDir}/**/*`)
.pipe(plumber(config.gulp.onError))
.pipe(gulp.dest(pathBuilder.docsImgDistDir))
);

/**
* `copy:fonts` Task
* ---------------------
Expand Down
2 changes: 1 addition & 1 deletion tasks/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gulp.task('default', callback => {
['copy:fonts', 'images'],
['css', 'scripts'],
['logger:createFile'],
...config.sw.isEnabled ? ['service-worker'] : [],
...(config.sw.isEnabled ? ['service-worker'] : []),
callback
);

Expand Down
8 changes: 1 addition & 7 deletions tasks/images.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ gulp.task('images', callback => {
'clean:images',
['copy:img', 'copy:assets'],
'images:optimise',
...(config.docs.outputAssets ? ['copy:img:docs'] : []),
'images:svg-sprite',
callback
);
Expand Down Expand Up @@ -51,13 +52,6 @@ gulp.task('images:optimise', () => gulp.src(`${pathBuilder.imgSrcDir}/**`)
})
], { verbose: config.isDev }))

.pipe(
gulpif(config.docs.outputAssets,
// write the files to the docs directory
gulp.dest(pathBuilder.docsImgDistDir)
)
)

// write the files to disk
.pipe(gulp.dest(`${pathBuilder.imgDistDir}`))

Expand Down

0 comments on commit f1a5973

Please sign in to comment.