-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGruntfile.js
104 lines (94 loc) · 3.05 KB
/
Gruntfile.js
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
module.exports = function (grunt) {
'use strict';
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compass: {
dev: {
options: {
sassDir: 'assets/styles/sass/',
cssDir: 'assets/styles/css/',
imagesDir: 'assets/images/',
fontsDir: 'assets/fonts/',
outputStyle: 'expanded',
generatedImagesDir: 'assets/images/sprites/',
relativeAssets: true
}
}
},
clean: {
'no-write': true,
compass: ['assets/styles/css/', 'assets/images/sprites/']
},
csslint: {
options: {
csslintrc: '.csslintrc'
}
},
jshint: {
all: ['Gruntfile.js', 'assets/scripts/require.config.js', 'assets/scripts/main.js', 'assets/scripts/modules/*.js'],
options: {
jshintrc: '.jshintrc'
}
},
connect: {
server: {
options: {
port: 9000,
hostname: 'localhost',
open: true
}
},
spec : {
options: {
base: ['.', 'spec'],
port: 9001,
hostname: 'localhost',
keepalive: true,
open: 'http://localhost:<%= connect.spec.options.port %>/SpecRunner.html'
}
}
},
watch: {
options: {
livereload: true
},
compass: {
files: ['assets/styles/sass/**/*'],
tasks: ['compass:dev']
},
scripts: {
files: ['assets/styles/scripts/main.js', 'assets/styles/scripts/modules/*.js'],
tasks: ['requirejs']
},
handlebars: {
files: ['assets/templates/*.html'],
tasks: ['requirejs']
}
},
requirejs: {
compile: {
options: {
name: 'assets/scripts/main',
baseUrl: './',
mainConfigFile: 'assets/scripts/require.config.js',
out: 'assets/scripts/main.optimized.js'
}
}
},
mocha: {
src: ['spec/SpecRunner.html'],
options: {
bail: true,
log: true,
reporter: 'Nyan'
}
}
});
grunt.registerTask('server', ['connect:server']);
grunt.registerTask('uglifyJS', ['uglify', 'clean:js']);
grunt.registerTask('buildCSS', ['clean:compass', 'compass:dev', 'csslint']);
grunt.registerTask('buildJS', ['jshint', 'requirejs']);
grunt.registerTask('build', ['buildCSS', 'buildJS']);
grunt.registerTask('dev', ['build', 'server', 'watch']);
};