-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.coffee
68 lines (66 loc) · 2.16 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
module.exports = (grunt) ->
# Project configuration
grunt.initConfig
pkg: grunt.file.readJSON("package.json")
concat:
dist:
#Libraries go Here
src: [
"assets/components/jquery/jquery.js",
"assets/components/angular/angular.js",
"assets/javascripts/<%= pkg.name %>.js"
]
dest: "assets/javascripts/application.js"
uglify:
options:
banner: "/*! <%= pkg.name %> <%= grunt.template.today(\"yyyy-mm-dd\") %> */\n"
build:
src: "assets/javascripts/application.js"
dest: "application.min.js"
less:
development:
options:
paths: ["assets/stylesheets"]
files:
"assets/stylesheets/application.css": "assets/stylesheets/<%= pkg.name %>.less"
production:
options:
paths: ["assets/stylesheets"]
yuicompress: true
files:
"application.min.css": "assets/stylesheets/<%= pkg.name %>.less"
coffee:
scripts:
files:
#Extra app .coffee files go here
"assets/javascripts/<%= pkg.name %>.js": [
"assets/javascripts/<%= pkg.name %>.coffee"
]
tests:
files:
"assets/javascripts/tests/unit/main.js": "assets/javascripts/tests/unit/**/*.coffee"
karma:
unit:
configFile: "assets/javascripts/tests/karma.conf.js"
singleRun: false
watch:
scripts:
files: "assets/javascripts/**/*.coffee"
tasks: ["coffee:scripts", "concat"]
tests:
files: ["assets/javascripts/tests/**/*.coffee"]
tasks: ["coffee:tests"]
styles:
files: "assets/stylesheets/**/*.less"
tasks: ["less:development"]
# Load the plugins
grunt.loadNpmTasks "grunt-contrib-uglify"
grunt.loadNpmTasks "grunt-contrib-watch"
grunt.loadNpmTasks "grunt-contrib-concat"
grunt.loadNpmTasks "grunt-contrib-less"
grunt.loadNpmTasks "grunt-contrib-coffee"
grunt.loadNpmTasks "grunt-karma"
# Tasks
grunt.registerTask "default", ["reset"]
grunt.registerTask "reset", ["coffee", "concat", "less:development", "watch"]
grunt.registerTask "launch", ["uglify", "less:production"]