-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
109 lines (106 loc) · 2.65 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
98
99
100
101
102
103
104
105
106
107
108
109
module.exports = function(grunt) {
var all = [
'jshint',
'ngmin',
'html2js',
'uglify',
'concat:js',
'concat:css',
'less',
'copy:dist',
];
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ['out', 'dist'],
ngmin: {
default: {
src: ['src/**/*.js'],
dest: 'out/pivotchart.js',
},
},
html2js: {
main: {
src: ['src/templates/**/*.html'],
dest: 'out/pivotchart-templates.js',
},
},
uglify: {
default: {
files: {
'out/pivotchart.min.js': [
'out/pivotchart.js',
'out/pivotchart-templates.js',
],
}
}
},
less: {
default: {
files: {
'dist/pivotchart.css': 'less/pivotchart.less',
},
},
},
concat: {
css: {
src: [
'bower_components/angular-bootstrap-colorpicker/css/colorpicker.css',
'bower_components/handsontable/dist/jquery.handsontable.full.css'
],
dest: 'dist/components.css',
},
js: {
src: [
'bower_components/angular-bootstrap-colorpicker/js/bootstrap-colorpicker-module.js',
'bower_components/angular-ui-sortable/sortable.js',
'bower_components/angular-ui-slider/src/slider.js',
'bower_components/handsontable/dist/jquery.handsontable.full.js',
'bower_components/d3-plugins/sankey/sankey.js',
],
dest: 'dist/components.js',
},
},
copy: {
dist: {
expand: true,
flatten: true,
filter: 'isFile',
src: [
'out/pivotchart.min.js',
'out/pivotchart.js',
'out/pivotchart-templates.js',
],
dest: 'dist/',
},
},
jshint: {
files: ['Gruntfile.js', 'src/**/*.js'],
},
watch: {
files: ['<%= jshint.files %>', 'index.html', 'src/**/*.html', 'less/**/*.less'],
tasks: all,
options: {
livereload: true,
},
},
express: {
options: {
script: 'server/server.js',
},
dev: {
},
},
});
grunt.loadNpmTasks('grunt-ngmin');
grunt.loadNpmTasks('grunt-html2js');
grunt.loadNpmTasks('grunt-express-server');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.registerTask('serve', ['default', 'express:dev', 'watch']);
grunt.registerTask('default', all);
};