-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathGruntfile.js
More file actions
53 lines (48 loc) · 1.65 KB
/
Gruntfile.js
File metadata and controls
53 lines (48 loc) · 1.65 KB
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
var fs = require('fs');
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('bower.json'),
concat: {
options: {
stripBanners: {
'block': true,
'line': true
},
banner: '/*\n<%= pkg.name %> <%= pkg.version %> - <%= pkg.description %> \nCopyright (C) 2014 - <%= pkg.authors %> and contributors \nLicense: <%= pkg.license %> \nSource: <%= pkg.homepage %> \nDate Compiled: <%= grunt.template.today("yyyy-mm-dd") %> \n*/\n'
},
dist: {
src: ['angular-progressbar.js'],
dest: 'dist/angular-progressbar.js'
}
},
uglify: {
options: {
banner: '/*\n<%= pkg.name %> <%= pkg.version %> - <%= pkg.description %> \nCopyright (C) 2014 - <%= pkg.authors %> and contributors \nLicense: <%= pkg.license %> \nSource: <%= pkg.homepage %> \nDate Compiled: <%= grunt.template.today("yyyy-mm-dd") %> \n*/\n',
sourceMap: true
},
build: {
src: 'dist/<%= pkg.name %>.js',
dest: 'dist/<%= pkg.name %>.min.js'
}
},
jshint: {
options: {
browser: true
},
all: 'src/*.js'
}
});
grunt.registerTask('version', function(file_version){
var bower = grunt.file.readJSON('bower.json');
var npm_package = grunt.file.readJSON('package.json');
bower.version = file_version;
npm_package.version = file_version;
fs.writeFileSync('bower.json', JSON.stringify(bower, null, 4));
fs.writeFileSync('package.json', JSON.stringify(npm_package, null, 4));
})
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-karma');
grunt.registerTask('default', ['jshint', 'concat', 'uglify']);
};