forked from jamendo/jamendo-contest
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathgulpfile.coffee
More file actions
71 lines (62 loc) · 1.49 KB
/
gulpfile.coffee
File metadata and controls
71 lines (62 loc) · 1.49 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
gulp = require('gulp-help')(require('gulp'),
hideEmpty: true
hideDepsMessage: true
)
gutil = require('gulp-util')
clean = require('gulp-clean')
plumber = require('gulp-plumber')
coffeelint = require('gulp-coffeelint')
stylish = require('coffeelint-stylish')
webpack = require('webpack')
gulpWebpack = require('gulp-webpack')
webpackConfig = require('./webpack.config.js')
gulp.task 'default', false, ['help']
gulp.task 'build', 'Build application',
[
'webpack:build'
'dist:prepare'
]
gulp.task 'webpack:build', false, ['build:clean'], (callback) ->
gulp
.src([
'./app/app'
])
.pipe(
plumber(
errorHandler: (err) ->
gutil.log '[error]', err.toString(colors: true)
process.exit(1)
)
)
.pipe(gulpWebpack(webpackConfig), webpack)
.pipe(gulp.dest('build/'))
gulp.task 'dist:prepare', false, ['dist:clean', 'webpack:build'], ->
gulp
.src([
'build/**'
'index.html'
'favicon.ico'
'robots.txt'
'server.js'
], base: '.')
.pipe(gulp.dest('dist/'))
gulp.task 'dist:clean', false, ->
gulp
.src('dist', read: false)
.pipe(clean())
gulp.task 'build:clean', false, ->
gulp
.src('build', read: false)
.pipe(clean())
gulp.task 'lint', 'Lint codebase',
[
'lint:coffee'
]
gulp.task 'lint:coffee', false, ->
gulp
.src([
'./app/**/*.coffee'
])
.pipe(coffeelint('./coffeelint.json'))
.pipe(coffeelint.reporter(stylish))
.pipe(coffeelint.reporter('failOnWarning'))