-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
executable file
·46 lines (40 loc) · 1.29 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
var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var sassPaths = [
'bower_components/normalize.scss/sass',
'bower_components/foundation-sites/scss',
'bower_components/motion-ui/src',
'node_modules/materialfoundation'
];
gulp.task('sass', function() {
return gulp.src('scss/app.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(gulp.dest('css'));
});
var uglify = require('gulp-uglify');
var concat = require('gulp-concat');
gulp.task('js', function() {
return gulp.src([
'./bower_components/jquery/dist/jquery.js',
'./bower_components/what-input/dist/what-input.js',
'./bower_components/foundation-sites/dist/js/foundation.js',
'./node_modules/materialfoundation/js/switches.js',
'./node_modules/materialfoundation/js/ripple.js',
'./node_modules/materialfoundation/js/floating-label.js',
'./js/scripts.js',
])
.pipe(concat('app.js'))
.pipe(uglify())
.pipe(gulp.dest('./scripts/'));
})
gulp.task('build', ['sass','js']);
gulp.task('default', ['sass','js'], function() {
gulp.watch(['scss/**/*.scss','js/**/*.js'], ['js']);
});