forked from jseppi/angular-dropdowns
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.coffee
110 lines (98 loc) · 3.05 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
path = require 'path'
# Build configurations.
module.exports = (grunt) ->
grunt.initConfig
# Deletes Compiled script directory
# These directories should be deleted before subsequent builds.
# These directories are not committed to source control.
clean:
working:
scripts: [
'./scripts/*'
]
# Compile CoffeeScript (.coffee) files to JavaScript (.js).
coffee:
src:
files: [
cwd: './src'
src: '**/*.coffee'
dest: './scripts'
expand: true
ext: '.js'
]
options:
# Don't include a surrounding Immediately-Invoked Function Expression (IIFE) in the compiled output.
# For more information on IIFEs, please visit http://benalman.com/news/2010/11/immediately-invoked-function-expression/
bare: true
# Copy dropdowns.js to the dist folder
copy:
dist:
files: [
{
src: ['./scripts/dropdowns.js']
dest: './dist/angular-dropdowns.js'
filter: 'isFile'
}
]
uglify:
dist:
options: {
#beautify: true
}
files: {
'./dist/angular-dropdowns.min.js': ['./dist/angular-dropdowns.js']
}
# Runs unit tests using karma
karma:
unit:
options:
autoWatch: true
browsers: ['Chrome']
colors: true
configFile: './test/karma-conf.js'
port: 8081
reporters: ['progress']
runnerPort: 9100
singleRun: true
# Sets up file watchers and runs tasks when watched files are changed.
watch:
coffee:
files: './src/**'
tasks: [
'coffee:src'
]
# Register grunt tasks supplied by grunt-contrib-*.
# Referenced in package.json.
# https://github.com/gruntjs/grunt-contrib
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-copy'
grunt.loadNpmTasks 'grunt-contrib-uglify'
# Register grunt tasks supplied by grunt-karma.
# Referenced in package.json.
# https://github.com/Dignifiedquire/grunt-testacular
grunt.loadNpmTasks 'grunt-karma'
# Compiles the app with non-optimized build settings and runs unit tests.
# Enter the following command at the command line to execute this build task:
# grunt test
grunt.registerTask 'test', [
'clean:working'
'default'
'karma'
]
# Compiles the app with non-optimized build settings.
# Enter the following command at the command line to execute this build task:
# grunt
grunt.registerTask 'default', [
'coffee:src'
'copy:dist'
'uglify:dist'
]
# Compiles the app with non-optimized build settings and watches changes.
# Enter the following command at the command line to execute this build task:
# grunt dev
grunt.registerTask 'dev', [
'coffee:src'
'watch'
]