-
Notifications
You must be signed in to change notification settings - Fork 17
/
Gruntfile.js
79 lines (63 loc) · 2.47 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
html2js: {
options: {
module: 'ngc-template'
},
main: {
src: ['src/**/*.tpl.html'],
dest: 'generated/template.js'
}
},
concat: {
options: {
separator: ''
},
dist: {
src: ['src/table.js', 'generated/template.js', 'bower_components/ng-scrollable/src/ng-scrollable.js' ],
dest: 'dist/<%= pkg.version %>/<%= pkg.name %>.js'
},
dist_latest: {
src: ['src/table.js', 'generated/template.js', 'bower_components/ng-scrollable/src/ng-scrollable.js'],
dest: 'dist/latest/<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> Copyright 2013,2014 Guy de Pourtalès. Licensed under the Apache License, Version 2.0 */\n'
},
build: {
src: 'dist/<%= pkg.version %>/<%= pkg.name %>.js',
dest: 'dist/<%= pkg.version %>/<%= pkg.name %>.min.js'
},
build_latest: {
src: 'dist/latest/<%= pkg.name %>.js',
dest: 'dist/latest/<%= pkg.name %>.min.js'
}
},
cssmin: {
combine: {
files: {
'dist/<%= pkg.version %>/<%= pkg.name %>.css': ['css/table.css', 'bower_components/ng-scrollable/min/ng-scrollable.min.css'],
'dist/latest/<%= pkg.name %>.css': ['css/table.css', 'bower_components/ng-scrollable/min/ng-scrollable.min.css']
}
},
minify: {
expand: true,
cwd: 'dist/',
src: ['<%= pkg.name %>-<%= pkg.version %>.css'],
dest: 'dist/',
ext: '.min.css'
}
}
});
// Load the plugin that provides the "concat" and "uglify" tasks.
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-html2js');
// Default task(s).
grunt.registerTask('default', ['html2js:main', 'concat:dist', 'concat:dist_latest', 'uglify', 'uglify:build_latest', 'cssmin' ]);
};