This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
114 lines (94 loc) · 3.33 KB
/
gulpfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var CacheBuster = require('gulp-cachebust');
var cachebust = new CacheBuster();
var $ = require('gulp-load-plugins')();
var sassPaths = [
'bower_components/foundation-sites/scss',
'bower_components/motion-ui/src'
];
var scriptPaths = [
'node_modules/lazysizes/lazysizes.min.js'
];
var nodeScripts = [
'node_modules/intersection-observer/intersection-observer.js',
'node_modules/iolazyload/dist/js/iolazy.min.js'
];
gulp.task('browser-sync', function() {
browserSync .init({
proxy: "bolt-extensions.dev/bolt/"
});
});
gulp.task('sass', function() {
return gulp.src('./web/scss/main.scss')
.pipe($.sass({
includePaths: sassPaths,
outputStyle: 'compressed' // if css compressed **file size**
})
.on('error', $.sass.logError))
.pipe($.autoprefixer({
browsers: ['last 2 versions', 'ie >= 9']
}))
.pipe( $.rename({
basename: "betterthumbs",
}))
.pipe(gulp.dest('../../../../public/extensions/vendor/cdowdy/betterthumbs/css') )
.pipe(gulp.dest('./web/css'))
.pipe(browserSync.stream());
});
gulp.task( 'docs_css', function () {
return gulp.src('./web/css/betterthumbs.css')
// .pipe($.concat('betterthumbs.files.css'))
// .pipe($.cssnano())
// .pipe(cachebust.resources())
// .pipe($.rename(function (path) {
// path.basename += '.min';
// return path;
// }))
.pipe(gulp.dest('../../../../public/extensions/vendor/cdowdy/betterthumbs/css'))
.pipe(gulp.dest('./web/css'))
});
gulp.task('docs_js', function () {
return gulp.src(['./web/js/betterthumbs.file.delete.js','./web/js/betterthumbs.prime.js', './web/js/awesomplete.js' ])
.pipe($.concat('betterthumbs.js'))
.pipe($.uglify())
// .pipe(cachebust.resources())
// .pipe($.rename(function (path) {
// path.basename += '.min';
// return path;
// }))
.pipe(gulp.dest('../../../../public/extensions/vendor/cdowdy/betterthumbs/js'))
.pipe(gulp.dest('./web/js'))
});
gulp.task( 'copy_assets', function() {
return gulp.src( scriptPaths )
.pipe(cachebust.resources())
// .pipe($.rename(function (path) {
// path.basename += '.min';
// return path;
// }))
.pipe(gulp.dest('../../../../public/extensions/vendor/cdowdy/betterthumbs/js'))
.pipe(gulp.dest('./web/js'))
});
gulp.task( 'copynodeassets' , function () {
return gulp.src( nodeScripts )
.pipe(cachebust.resources())
.pipe($.uglify())
// .pipe($.rename(function (path) {
// path.basename += '.min';
// return path;
// }))
// .pipe(gulp.dest('../../public/extensions/vendor/cdowdy/betterthumbs/js'))
.pipe(gulp.dest('./web/js'))
});
gulp.task('dev', ['sass'], function() {
browserSync.init({
proxy: "bolt-extensions.dev/bolt/"
});
gulp.watch(['./web/scss/**/**/*.scss'], ['sass']);
gulp.watch(['../templates/**/**/**.twig']).on('change', browserSync.reload);
});
gulp.task('default', ['sass'], function() {
gulp.watch(['./web/scss/**/*.scss'], ['sass']);
gulp.watch(['../templates/betterthumbs.docs.html.twig']).on('change', browserSync.reload);
});