-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgulpfile.js
53 lines (46 loc) · 1.48 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
var gulp = require('gulp'),
gulpLoadPlugins = require('gulp-load-plugins'),
plugins = gulpLoadPlugins();
gulp.task('js', function () {
return gulp.src([
'bower_components/jquery/dist/jquery.js',
'bower_components/bootstrap-sass/assets/javascripts/bootstrap.js',
'dist/js/**/*.js'
])
.pipe(plugins.concat('main.min.js'))
.pipe(plugins.uglify())
.pipe(plugins.sourcemaps.write('./'))
.pipe(gulp.dest('public/js'));
});
gulp.task('scss', function () {
return gulp.src([
'bower_components/bootstrap-sass/assets/stylesheets/_bootstrap.scss',
'dist/scss/**/*.scss'])
.pipe(plugins.scss())
.pipe(plugins.concat('main.min.css'))
.pipe(plugins.uglifycss())
.pipe(plugins.cleanCss({
keepSpecialComments: 0
}))
.pipe(plugins.sourcemaps.write('./'))
.pipe(gulp.dest('public/css'));
});
gulp.task('img', function() {
return gulp.src('dist/img/**/*.*')
.pipe(gulp.dest('public/img'));
});
gulp.task('fonts', function() {
return gulp.src('dist/fonts/**/*.*')
.pipe(gulp.dest('public/fonts'));
});
gulp.task('default', ['js', 'scss', 'img', 'fonts']);
gulp.task('watcher', function() {
var watcher = gulp.watch(
'dist/**/**.*',
['default']
);
watcher.on('change', function(event) {
console.log('Event type: ' + event.type);
console.log('Event path: ' + event.path);
});
});