-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGulpfile.js
44 lines (40 loc) · 1.5 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
var gulp = require('gulp'),
watch = require('gulp-watch'),
sass = require('gulp-sass'),
uglify = require('gulp-uglifyjs'),
rename = require('gulp-rename');
var paths = {
stylesheets: [
'assets/stylesheets/**/*.scss',
'bower_components/bootstrap-sass-official/vendor/assets/stylesheets/**/*.scss'
],
javascripts: [
'bower_components/jquery/dist/jquery.min.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/alert.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/collapse.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/dropdown.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/tab.js',
'bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap/modal.js',
'bower_components/bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js',
'bower_components/tinymce/tinymce.js',
'assets/javascripts/**/*.js'
]
};
gulp.task('sass', function() {
return gulp.src(paths.stylesheets)
.pipe(sass())
.pipe(gulp.dest('public/stylesheets'));
});
gulp.task('uglify', function () {
return gulp.src(paths.javascripts)
.pipe(uglify({
mangle: false
}))
.pipe(rename('application.min.js'))
.pipe(gulp.dest('public/javascripts'));
});
gulp.task('watch', function () {
gulp.watch(paths.stylesheets, ['sass']);
gulp.watch(paths.javascripts, ['uglify']);
});