-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
123 lines (122 loc) · 2.88 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
css: {
src: [
'src/**/*.css'
],
dest: 'dist/ldv.css'
},
js: {
src: [
'js/*.js'
],
dest: 'dist/ldv.js'
},
scss: {
src: [
'src/ldv.scss',
'src/**/*.scss'
],
dest: 'dist/ldv.scss'
},
srcjs: {
src: [
'src/ldv.js',
'src/controller.js',
'src/pretty/**/*.js',
'src/services/**/*.js',
'src/taf/**/*.js',
'src/tools/**/*.js',
'src/triple-table/**/*.js',
'src/ui/**/*.js',
'dist/tpls/*.js'
],
dest: 'dist/ldv.js'
},
config: {
src: ['src/dist/config.js'],
dest: 'dist/cfg.js'
},
actions: {
src: ['src/dist/actions/*.js'],
dest: 'dist/actions.js'
}
},
cssmin: {
css: {
src: 'dist/ldv.css',
dest: 'dist/ldv.css'
}
},
ngmin: {
dist: {
files: {
'dist/ldv.js': ['dist/ldv.js']
}
}
},
uglify: {
js: {
files: {
'dist/ldv.js': ['dist/ldv.js']
}
},
config: {
src: 'dist/cfg.js',
dest: 'dist/cfg.js'
},
actions: {
src: 'dist/actions.js',
dest: 'dist/actions.js'
}
},
html2js: {
options: {
module: function(obj, target) {return "ldv.templates."+target;}
},
pretty: {
src: 'src/pretty/**/*.html',
dest: 'dist/tpls/pretty.js'
},
ui: {
src: 'src/ui/**/*.html',
dest: 'dist/tpls/ui.js'
},
tripletable: {
src: 'src/triple-table/**/*.html',
dest: 'dist/tpls/tripletable.js'
},
main: {
src: 'src/tpl/*.html',
dest: 'dist/tpls/main.js'
}
},
sass: {
dist: {
src: 'dist/ldv.scss',
dest: 'dist/ldv.css'
}
},
watch: {
files: ['src/*', 'src/*/*'],
tasks: ['buildSrc']
}
});
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-ngmin');
grunt.loadNpmTasks('grunt-html2js');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default', ['build']);
grunt.registerTask('build',
['buildConfig', 'buildActions', 'buildSrc', 'buildCss']);
grunt.registerTask('buildSass', ['concat:scss', 'sass', 'cssmin']);
grunt.registerTask('buildConfig', ['concat:config', 'uglify:config']);
grunt.registerTask('buildActions', ['concat:actions', 'uglify:actions']);
grunt.registerTask('buildSrc', ['html2js', 'concat:srcjs', 'ngmin:dist'/*, 'uglify:js'*/]);
grunt.registerTask('buildCss', ['concat:css','cssmin']);
};