-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
94 lines (90 loc) · 2.44 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
dist: {
src: ['bower_components/jquery-overlaps/jquery.overlaps.js', 'src/**/*.js'],
dest: 'dist/jquery.inline-footnotes.js'
}
},
uglify: {
options: {
banner: '/*! \n * <%= pkg.name %> v<%= pkg.version %>\n * \n * Copyright 2015 Andrew Pilsch <apilsch@tamu.edu> (http://andrew.pilsch.com)\n * \n * (also contains jquery-overlaps v 1.2.3, Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net))\n * \n * Built On: <%= grunt.template.today("dd-mm-yyyy") %>\n *\n */\n',
},
dist: {
src: 'dist/jquery.inline-footnotes.js',
dest: 'dist/jquery.inline-footnotes.min.js'
}
},
cssmin: {
dist: {
src: 'stylesheets/jquery.inline-footnotes.css',
dest: 'dist/jquery.inline-footnotes.min.css'
}
},
clean: {
js: ["dist/*.js", "!dist/*.min.js"]
},
usebanner: {
taskName: {
options: {
position: 'top',
banner: '/*! \n * <%= pkg.name %> v<%= pkg.version %>\n * \n * Copyright 2015 Andrew Pilsch <apilsch@tamu.edu> (http://andrew.pilsch.com)\n * \n * Built On: <%= grunt.template.today("dd-mm-yyyy") %>\n *\n */',
linebreak: true,
replace: /\/\*\![\s\S]*\*\//m
},
files: {
src: ['src/**/*.js']
}
}
},
compass: {
dist: {
options: {
config: 'config.rb'
}
}
},
/*
* Usage (https://github.com/vojtajina/grunt-bump):
*
* grunt bump:[major|minor|patch]
*
* grunt bump-only:[major|minor|patch]
* grunt commit
*
*/
bump: {
options: {
files: ['package.json', 'bower.json'],
commitFiles: ['package.json', 'bower.json'],
pushTo: 'origin'
}
},
watch: {
js: {
files: ['src/**/*.js'],
tasks: ['js']
},
css: {
files: ['stylesheets/**/*.scss'],
tasks: ['css']
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-banner');
grunt.loadNpmTasks('grunt-bump');
grunt.registerTask('css', ['compass', 'cssmin']);
grunt.registerTask('js', ['usebanner', 'concat', 'uglify', 'clean']);
//grunt.registerTask('watch', ['watch:css', 'watch:js']);
grunt.registerTask('default', ['js', 'css']);
};