-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
40 lines (31 loc) · 1.07 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
var gulp = require('gulp');
var coffeeify = require('gulp-coffeeify');
var ejs = require('ejs');
var sass = require('gulp-sass');
var concat = require('gulp-concat');
var clean = require('gulp-clean');
var precompileTemplate = function (template) {
return 'module.exports = ' + ejs.compile(template, {client: true}) + '';
};
gulp.task('clean', function () {
return gulp.src('web/bundles/app/*', {read: false})
.pipe(clean());
});
gulp.task('scripts', ['clean'], function () {
gulp.src('app/Resources/assets/scripts/app.coffee')
.pipe(coffeeify({
transforms: [
{ext: '.ejs', transform: precompileTemplate}
]
}))
.pipe(gulp.dest('web/bundles/app/js'))
});
gulp.task('styles', ['clean'], function () {
gulp.src('app/Resources/assets/fonts/**/*')
.pipe(gulp.dest('web/bundles/app/fonts'));
gulp.src('app/Resources/assets/styles/app.scss')
.pipe(sass())
.pipe(concat('app.css'))
.pipe(gulp.dest('web/bundles/app/css'))
});
gulp.task('default', ['scripts', 'styles']);