This repository has been archived by the owner on May 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
99 lines (87 loc) · 1.79 KB
/
Gruntfile.coffee
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
'use strict'
module.exports = (grunt) ->
require('matchdep').filterDev('grunt-*').forEach grunt.loadNpmTasks
grunt.initConfig
buildDir: './build'
srcDir: './src'
tmpDir: '.tmp'
pkg: grunt.file.readJSON 'package.json'
src:
coffee: [ '<%= srcDir %>/scripts/coffee/**/*.coffee' ]
less: '<%= srcDir %>/styles/<%= pkg.name %>.less'
#jade: 'jade/*.jade'
clean:
tmp: [ '.tmp' ]
recess:
build:
src: [ '<%= src.less %>' ],
dest: '<%= buildDir %>/css/<%= pkg.name %>.css',
options:
compile: true
compress: true
coffee:
build:
options:
bare: true
files: [
expand: true,
cmd: 'coffee',
src: [ '<%= src.coffee %>' ],
dest: '.tmp/js/',
ext: '.js'
]
concat:
build:
src: [
'module.prefix'
'.tmp/js/**/*.js'
'module.suffix'
]
dest: '<%= tmpDir %>/js/<%= pkg.name %>.js'
# Annotate angular sources
ngmin:
build:
src: [ '<%= tmpDir %>/js/<%= pkg.name %>.js' ]
dest: '<%= buildDir %>/js/<%= pkg.name %>.annotated.js'
# Minify the sources!
uglify:
build:
files:
'<%= buildDir %>/js/<%= pkg.name %>.min.js': [ '<%= buildDir %>/js/<%= pkg.name %>.annotated.js' ]
delta:
options:
livereload: true
# js:
# files: [ '<%= src.js %>' ]
# tasks: [
# 'concat'
# 'ngmin'
# 'uglify'
# ]
coffee:
files: [ '<%= src.coffee %>' ]
tasks: [
'clean'
'coffee'
'concat'
'ngmin'
'uglify'
]
less:
files: [ '<%= src.less %>' ]
tasks: [ 'recess' ]
grunt.renameTask 'watch', 'delta'
grunt.registerTask 'watch', [
'build'
'delta'
]
# The default task is to build.
grunt.registerTask 'default', [ 'build' ]
grunt.registerTask 'build', [
'clean'
'recess'
'coffee'
'concat'
'ngmin'
'uglify'
]