update and vaildation
* updated dependencies * added html validator * checked html results * new readme
This commit is contained in:
parent
d18254b61d
commit
9b9b0cb1c6
10 changed files with 1519 additions and 723 deletions
12
gulpfile.js
12
gulpfile.js
|
|
@ -35,10 +35,11 @@ const changed = require('gulp-changed');
|
|||
const merge = require('merge-stream');
|
||||
const spritesmith = require('gulp.spritesmith');
|
||||
const babel = require('gulp-babel');
|
||||
const htmlValidator = require('gulp-w3c-html-validator');
|
||||
// const buffer = require('vinyl-buffer');
|
||||
// const imagemin = require('gulp-imagemin');
|
||||
|
||||
// Paths to data
|
||||
// Data variables
|
||||
const input = {
|
||||
root: 'source',
|
||||
screens: 'source/screens/**/*.+(njk|html)',
|
||||
|
|
@ -94,8 +95,6 @@ if (fs.existsSync('source/data/data.json')) {
|
|||
|
||||
// Clean build folder
|
||||
function clean () {
|
||||
// You can use multiple globbing patterns as you would with `gulp.src`,
|
||||
// for example if you are using del 2.0 or above, return its promise
|
||||
return del(output.root +'/**');
|
||||
}
|
||||
|
||||
|
|
@ -134,6 +133,12 @@ function nunjucks () {
|
|||
.pipe(dest(output.root));
|
||||
}
|
||||
|
||||
function validate () {
|
||||
return src('build/**/*.html')
|
||||
.pipe(htmlValidator())
|
||||
.pipe(htmlValidator.reporter());
|
||||
}
|
||||
|
||||
// Serve files to the browser
|
||||
function serve (done) {
|
||||
server.init({
|
||||
|
|
@ -285,6 +290,7 @@ const build = series(clean, assets, parallel(nunjucks, style, code));
|
|||
const dev = series(clean, assets, parallel(nunjucks, series(styleLint, style), series(codeLint, code)));
|
||||
|
||||
exports.lint = parallel(series(style, styleLint), series(code, codeLint));
|
||||
exports.validate = series(nunjucks, validate);
|
||||
exports.assets = assets;
|
||||
exports.build = build;
|
||||
exports.dev = dev;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue