forked from yakworks/angle-grinder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
123 lines (99 loc) · 2.72 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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
module.exports = (grunt) ->
# load all grunt tasks
require("load-grunt-tasks")(grunt)
grunt.loadTasks("grunt-tasks")
config = (name) ->
require("./grunt-tasks/config/#{name}")(grunt, appConfig)
# configurable paths
appConfig =
app: "src"
test: "tests"
dist: "dist"
dev: "build"
grunt.initConfig
appConfig: appConfig
pkg: grunt.file.readJSON("package.json")
# Run tasks whenever watched files change
watch: config "watch"
# Compile CoffeeScript files to JavaScript
coffee: config "coffee"
# Lint your CoffeeScript using grunt.js and coffeelint
coffeelint: config "coffeelint"
# Compile LESS files to CSS
less: config "less"
# Concatenate files
concat: config "concat"
# Minify HTML
htmlmin: config "htmlmin"
# Tgruask to concatenate & pre-load your AngularJS templates
ngtemplates: config "ngtemplates"
# Minify files with UglifyJS
uglify: config "uglify"
# Clear files and folders
clean: config "clean"
# Copy files and folders
copy: config "copy"
# General purpose text replacement for grunt
replace: config "replace"
# Grunt plugin for Bower
bower: config "bower"
# Publish to GitHub pages
"gh-pages": config "gh-pages"
# Replaces references to non-optimized scripts or stylesheets into a set of HTML files
useminPrepare: config "usemin_prepare"
usemin: config "usemin"
# Plugin for Karma
karma: config "karma"
# Start a static web server
connect: config "connect"
# Update your devDependencies and dependencies automatically with a grunt task
devUpdate: config "devUpdate"
grunt.renameTask "regarde", "watch"
grunt.registerTask "build:dev", [
"clean"
"bower"
"coffeelint"
"coffee"
"less"
"copy:dev"
"ngtemplates:exampleApp"
"replace"
]
grunt.registerTask "server", [
"build:dev"
"configureProxies"
"livereload-start"
"connect:livereload"
"watch"
]
# run unit tests
grunt.registerTask "test:unit", [
"karma:unit"
]
# run unit tests in the watch mode
grunt.registerTask "test:unit:watch", [
"karma:watch"
]
# run unit tests in the watch mode
grunt.registerTask "test:watch", [
"test:unit:watch"
]
grunt.registerTask "test", [
"karma:unit"
]
grunt.registerTask "build:dist", [
"test"
"build:dev"
"copy:dist"
"useminPrepare"
"htmlmin"
"concat"
"usemin"
"uglify"
"cssmin"
]
grunt.renameTask "build:dist", "build"
grunt.registerTask "test:watch", [
"karma:watch"
]
grunt.registerTask "default", ["test"]