forked from NCSU-Libraries/ncsulib_foundation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
executable file
·49 lines (46 loc) · 1.49 KB
/
Gruntfile.js
File metadata and controls
executable file
·49 lines (46 loc) · 1.49 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {
scripts: ['templates/includes/scripts/*'],
hooks: ['.git/hooks/pre-commit']
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n',
preserveComments: false,
mangle: {
except: 'nav'
}
},
build: {
src: ['scripts/vendor/foundation/foundation.js',
'scripts/vendor/foundation/foundation.*.js',
'scripts/modernizr-tests.js',
'scripts/primary-nav.js',
'scripts/search-bar.js',
'scripts/vendor/jquery.autocomplete.js',
'scripts/vendor/jquery.mockjax.js',
'scripts/vendor/jquery.hoverIntent.minified.js',
'scripts/global-htdocs.js',
'scripts/search-cancel-button.js',
'scripts/handlebars-v1.3.0.js',
'scripts/date-picker.js'],
dest: 'templates/includes/scripts/<%= pkg.name %>.min.js'
}
},
shell: {
hooks: {
command: 'cp git-hooks/pre-commit .git/hooks/ && chmod -R +x .git/hooks/'
}
}
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-clean');
// clean out the old js, compress new js
grunt.registerTask('mini', ['clean:scripts', 'uglify']);
// create pre-commit hook
grunt.registerTask('githook', ['clean:hooks', 'shell:hooks']);
};