This repository has been archived by the owner on Feb 1, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
/
GruntFile.js
85 lines (84 loc) · 2.24 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
module.exports = function(grunt) {
var srcPath = ["scripts/**/*.js"];
var stylePath = ["styles/main.css", "styles/docs.css"];
var testePath = "spec/*Spec.js";
var libPaths = ['polyfills/polyfill.js', 'bower_components/jquery/dist/jquery.min.js', 'bower_components/flatdoc/legacy.js', 'bower_components/flatdoc/flatdoc.js', 'scripts/flatdoc-theme.js', 'bower_components/angular/angular.js', 'bower_components/angular-route/angular-route.js', 'bower_components/angular-sanitize/angular-sanitize.min.js', 'bower_components/js-schema/js-schema.min.js', 'bower_components/google-code-prettify/bin/prettify.min.js', 'bower_components/bootstrap/dist/js/bootstrap.min.js'];
grunt.initConfig({
concat: {
default: {
options: {
process: function(src, filepath) {
return '\n' + '// FILE: ' + filepath + '\n' + src;
}
},
src: srcPath,
dest: 'dist/js/main.js',
}
},
jshint: {
all: ['Gruntfile.js', srcPath]
},
uglify: {
options: {
mangle: false,
compress: false,
report: 'min',
// the banner is inserted at the top of the output
banner: '/*! <%= grunt.template.today("dd-mm-yyyy") %> */\n'
},
dist: {
files: {
'dist/js/main.min.js': [srcPath]
}
},
unicfile: {
files: {
'dist/js/main.unique.js': libPaths.concat([srcPath])
}
}
},
cssmin: {
dev: {
options: {
report: "min"
},
src: stylePath,
dest: "dist/css/main.min.css",
}
},
jasmine: {
pivotal: {
src: [srcPath],
options: {
specs: testePath,
helpers: 'spec/*Helper.js',
vendor: libPaths,
}
}
},
watch: {
scripts: {
files: [srcPath, testePath],
tasks: ['jshint', 'uglify', 'concat', 'jasmine'],
options: {
spawn: false,
},
},
},
bump: {
options: {
files: ['bower.json'],
commitFiles: ["-a"],
push: false
}
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-bump');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.registerTask('default', ['jshint', 'jasmine', 'concat:default', 'uglify', 'cssmin']);
};