-
Notifications
You must be signed in to change notification settings - Fork 343
/
Gruntfile.js
97 lines (83 loc) · 2.59 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
module.exports = function (grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
bower: {
install: {
options: {
copy: false // leave components in bower_components/
}
}
},
shell: {
'bower_csv-js': {
command: [
'npm install',
'grunt'
].join('&&'),
options: {
execOptions: {
cwd: 'bower_components/csv-js'
}
}
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: ['Gruntfile.js', 'src/js/**/*.js']
},
copy: {
build: {
files: [
{expand: true, cwd: 'src/', src: ['**'], dest: 'build/'}
]
},
bower: {
files: [
{
expand: true,
cwd: 'bower_components/csv-js/dist/',
src: ['**'],
dest: 'build/lib/csv-js/'
},
{
expand: true,
cwd: 'bower_components/json2/',
src: ['json2.js'],
dest: 'build/lib/json2/'
}
]
},
dist: {
files: [
{expand: true, cwd: 'build/', src: ['**'], dest: 'dist/'}
]
}
},
clean: {
build: ['build', 'bower_components'],
dist: ['dist']
}
});
// Load Grunt tasks from NPM packages
grunt.loadNpmTasks('grunt-bower-task');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
// Default task(s).
grunt.registerTask('default', [
'clean:build', // start with a clean slate
'clean:dist',
'jshint', // lint our JS in src/
'copy:build', // copy our JS from src/ to build/
'bower', // install Bower components
'shell:bower_csv-js', // run post-install commands
'copy:bower', // copy Bower components to build/lib/
'copy:dist', // copy everything to dist/
'clean:build' // cleanup build/
]);
};