-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathGruntfile.js
108 lines (105 loc) · 2.42 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
105
106
107
108
module.exports = function(grunt) {
grunt.initConfig({
config: {
dist: 'rama'
},
jshint: {
all: ['Gruntfile.js', 'js/**/*.js', 'test/*.js']
},
jasmine: {
src: ['js/**/*.js'],
options: {
vendor: [
'bower_components/underscore/underscore.js',
'bower_components/jquery/dist/jquery.js',
'bower_components/vis/dist/vis.js',
'bower_components/jasmine-jquery/lib/jasmine-jquery.js'
],
helpers: ['test/spechelper.js'],
specs: ['test/*.spec.js']
}
},
compass: {
dev: {
options: {
sassDir: 'sass',
cssDir: 'css'
}
}
},
watch: {
files: ['Gruntfile.js', 'js/**/*.js', 'sass/*.scss', 'test/*.js'],
tasks: ['compass', 'jshint']
},
useminPrepare: {
html: 'index.html',
options: {
dest: '<%= config.dist %>'
}
},
usemin: {
html: ['<%= config.dist %>/index.html'],
css: ['<%= config.dist %>/css/{,*/}*.css'],
options: {
assetDirs: ['<%= config.dist %>', '<%= config.dist %>/img']
}
},
copy: {
dist: {
files: [{
expand: true,
dot: true,
cwd: '.',
dest: '<%= config.dist %>',
src: [
'index.html',
'css/main.css',
'img/*',
'views/*.html',
'js/**/*',
'manifest.json'
]
}]
},
js: {
src: '.tmp/concat/js/vendor.js',
dest: '<%= config.dist %>/js/vendor.js'
},
css: {
src: '.tmp/concat/css/vendor.css',
dest: '<%= config.dist %>/css/vendor.css'
}
},
clean: {
dist: {
files: [{
dot: true,
src: [
'.tmp',
'<%= config.dist %>/*',
]
}]
},
server: '.tmp'
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-usemin');
grunt.registerTask('test', [
'jshint',
'jasmine'
]);
grunt.registerTask('build', [
'clean:dist',
'useminPrepare',
'concat',
'copy',
'usemin'
]);
};