mirror of
https://github.com/seigler/seigler.github.io
synced 2025-07-27 07:16:09 +00:00
add file-revision hashing
This commit is contained in:
parent
b0658a3ad4
commit
548c6b88f7
3 changed files with 13 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -3,3 +3,4 @@
|
||||||
# Example .gitignore files: https://github.com/github/gitignore
|
# Example .gitignore files: https://github.com/github/gitignore
|
||||||
/node_modules/
|
/node_modules/
|
||||||
/dist/
|
/dist/
|
||||||
|
/cdn/
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.9 MiB |
14
gulpfile.js
14
gulpfile.js
|
@ -1,4 +1,6 @@
|
||||||
/*jslint node: true */
|
/*jslint
|
||||||
|
node: true
|
||||||
|
regexp: true*/
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -22,6 +24,7 @@ var gulp = require('gulp'),
|
||||||
svgstore = require('gulp-svgstore'), // combines SVGs into a sprite sheet
|
svgstore = require('gulp-svgstore'), // combines SVGs into a sprite sheet
|
||||||
svgmin = require('gulp-svgmin'), // minifies SVGs to save filesize
|
svgmin = require('gulp-svgmin'), // minifies SVGs to save filesize
|
||||||
notify = require('gulp-notify'), // pops up OS notifications
|
notify = require('gulp-notify'), // pops up OS notifications
|
||||||
|
revAll = require('gulp-rev-all'), // hashes static resources, updates references to them
|
||||||
path = require('path'),
|
path = require('path'),
|
||||||
spawn = require('child_process').spawn,
|
spawn = require('child_process').spawn,
|
||||||
// Define source and destination paths
|
// Define source and destination paths
|
||||||
|
@ -113,7 +116,7 @@ gulp.task('build:icons', function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('clean:site', function () {
|
gulp.task('clean:site', function () {
|
||||||
return gulp.src('./build', {read: false})
|
return gulp.src(['./build', './cdn'], {read: false})
|
||||||
.pipe(clean());
|
.pipe(clean());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -139,6 +142,13 @@ gulp.task('build:site', ['clean:site', 'build:less', 'build:icons'], function ()
|
||||||
|
|
||||||
child.on('close', function (code) {
|
child.on('close', function (code) {
|
||||||
gutil.log("Done with exit code", code);
|
gutil.log("Done with exit code", code);
|
||||||
|
gulp.src('./dist/**')
|
||||||
|
.pipe(revAll.revision({ dontRenameFile: [
|
||||||
|
/^\/favicon\.ico$/g,
|
||||||
|
/.*\.html$/g,
|
||||||
|
/.*\.xml$/g
|
||||||
|
] }))
|
||||||
|
.pipe(gulp.dest('./cdn'));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue