forked from codeforjapan/mapprint
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
47 lines (41 loc) · 1.06 KB
/
Copy pathgulpfile.js
File metadata and controls
47 lines (41 loc) · 1.06 KB
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
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var browserify = require('browserify');
var sass = require('gulp-sass');
var neat = require('node-neat');
var jsConf = {
srcPath: 'source/javascripts/all.js',
destFileName: 'javascripts/bundle.js',
destPath: '.tmp/dist/'
}
var cssConf = {
srcPath: 'source/stylesheets/**/*.scss',
destFileName: 'site',
destPath: '.tmp/dist/stylesheets'
}
var b = browserify({
entries: jsConf.srcPath,
cache: {},
packageCache: {}
});
gulp.task('default', ['build']);
gulp.task('build', ['sass', 'bundle']);
gulp.task('watch', function(){
gulp.watch([jsConf.srcPath, cssConf.srcPath], ['build']);
});
gulp.task('bundle', jsBundle);
gulp.task('sass', sassPreCompile);
function jsBundle() {
return b
.plugin('tsify')
.bundle()
.pipe(source(jsConf.destFileName))
.pipe(gulp.dest(jsConf.destPath));
}
function sassPreCompile(){
gulp.src(cssConf.srcPath)
.pipe(sass({
includePaths: cssConf.destFileName
}))
.pipe(gulp.dest(cssConf.destPath));
}