forked from AddressFinder/addressfinder-magento
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
44 lines (38 loc) · 1.18 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');
var coffeelint = require('gulp-coffeelint');
var concat = require('gulp-concat');
var watch = require('gulp-watch');
var coffee = require('gulp-coffee');
// Configuration
var coffeeFiles = './src/*.coffee';
var distFolder = './view/frontend/web/js';
var distFileName = 'addressfinder-magento.js';
gulp.task('default', ['lint', 'concat', 'js-watch'], function() {
// place code for your default task here
console.log('Build complete');
});
gulp.task('production', ['lint', 'concat'], function() {
// place code for your default task here
console.log('Build complete');
});
gulp.task('lint', function() {
gulp.src(coffeeFiles)
.pipe(coffeelint())
.pipe(coffeelint.reporter())
.pipe(coffeelint.reporter('fail'));
});
gulp.task('concat', function() {
return gulp.src(coffeeFiles)
.pipe(coffee({bare: true}))
.pipe(concat(distFileName))
.pipe(gulp.dest(distFolder));
});
gulp.task('js-watch', function() {
return watch(coffeeFiles, function(){
console.log('Watch triggered');
gulp.src(coffeeFiles)
.pipe(coffee({bare: true}))
.pipe(concat(distFileName))
.pipe(gulp.dest(distFolder));
});
});