Add gulp-rev-all for future use
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
node_modules
|
node_modules
|
||||||
|
cdn
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ let cleanCSS = require('gulp-clean-css');
|
|||||||
let uglify = require('gulp-uglify');
|
let uglify = require('gulp-uglify');
|
||||||
let concat = require('gulp-concat');
|
let concat = require('gulp-concat');
|
||||||
let gulpCopy = require('gulp-copy');
|
let gulpCopy = require('gulp-copy');
|
||||||
|
let RevAll = require('gulp-rev-all');
|
||||||
|
|
||||||
gulp.task('styles', () => {
|
gulp.task('styles', () => {
|
||||||
return gulp.src([
|
return gulp.src([
|
||||||
@@ -44,5 +45,13 @@ gulp.task('copy:html', () => {
|
|||||||
.pipe(gulp.dest('dist'))
|
.pipe(gulp.dest('dist'))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Experimental
|
||||||
|
gulp.task('cdn', () => {
|
||||||
|
return gulp
|
||||||
|
.src('dist/**')
|
||||||
|
.pipe(RevAll.revision({ dontRenameFile: ['.html', '.png', '.svg', '.jpeg', '.jpg']}))
|
||||||
|
.pipe(gulp.dest('cdn'));
|
||||||
|
})
|
||||||
|
|
||||||
gulp.task('copy', ['copy:images', 'copy:html', 'copy:fonts'])
|
gulp.task('copy', ['copy:images', 'copy:html', 'copy:fonts'])
|
||||||
gulp.task('build', ['styles', 'scripts', 'copy']);
|
gulp.task('build', ['styles', 'scripts', 'copy']);
|
||||||
|
|||||||
30
dist/index.html
vendored
30
dist/index.html
vendored
@@ -554,22 +554,7 @@
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
|
||||||
/*
|
|
||||||
var sent = false;
|
|
||||||
window.addEventListener('scroll', function(e) {
|
|
||||||
var scrollTop = $(window).scrollTop();
|
|
||||||
var docHeight = $(document).height();
|
|
||||||
var winHeight = $(window).height();
|
|
||||||
var scrollPercent = (scrollTop) / (docHeight - winHeight);
|
|
||||||
var scrollPercentRounded = Math.round(scrollPercent*100);
|
|
||||||
|
|
||||||
if (scrollPercentRounded > 30 && !sent) {
|
|
||||||
ga('send', 'pageview');
|
|
||||||
sent = true;
|
|
||||||
}
|
|
||||||
}); */
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -587,6 +572,21 @@ window.addEventListener('scroll', function(e) {
|
|||||||
|
|
||||||
<!-- all bundles -->
|
<!-- all bundles -->
|
||||||
<script src="all.js"></script>
|
<script src="all.js"></script>
|
||||||
|
<script>
|
||||||
|
|
||||||
|
var sent = false;
|
||||||
|
window.addEventListener('scroll', function(e) {
|
||||||
|
var scrollTop = $(window).scrollTop();
|
||||||
|
var docHeight = $(document).height();
|
||||||
|
var winHeight = $(window).height();
|
||||||
|
var scrollPercent = (scrollTop) / (docHeight - winHeight);
|
||||||
|
var scrollPercentRounded = Math.round(scrollPercent*100);
|
||||||
|
|
||||||
|
if (scrollPercentRounded > 30 && !sent) {
|
||||||
|
ga('send', 'pageview');
|
||||||
|
sent = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
"gulp-clean-css": "^3.9.0",
|
"gulp-clean-css": "^3.9.0",
|
||||||
"gulp-concat": "^2.6.1",
|
"gulp-concat": "^2.6.1",
|
||||||
"gulp-copy": "^1.0.1",
|
"gulp-copy": "^1.0.1",
|
||||||
|
"gulp-rev-all": "^0.9.7",
|
||||||
"gulp-uglify": "^3.0.0"
|
"gulp-uglify": "^3.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user