-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgruntfile.js
198 lines (182 loc) · 5.16 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
/// <binding ProjectOpened='watch' />
/*
This file in the main entry point for defining grunt tasks and using grunt plugins.
Click here to learn more. http://go.microsoft.com/fwlink/?LinkID=513275&clcid=0x409
*/
module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-angular-templates');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-sync');
var rootGitFolder = "./";
grunt.initConfig({
// javascript
concat: {
options: {
separator: grunt.util.linefeed + grunt.util.linefeed,
process: function (src, filepath) {
return '/* #### File: ' + filepath + ' */ \n' + src;
}
},
dist: {
// first load the app.js from each module
src: [
'./src/Scripts/app/app.js',
'./src/Scripts/app/FilterTable/app.js',
'./src/Scripts/app/superAdmin/app.js',
'./src/Scripts/app/**/*.js'
],
dest: rootGitFolder + 'dist/js/SmlAppl.WebApps.NgFramework.js',
}
},
uglify: {
app: {
src: rootGitFolder + 'dist/js/SmlAppl.WebApps.NgFramework.js',
dest: rootGitFolder + 'dist/js/SmlAppl.WebApps.NgFramework.min.js'
}
},
ngtemplates: {
'smlAppl.webApps.framework': {
src: './Views/**/*.html',
dest: './src/Scripts/app/Config/templates.js'
},
'smlAppl.webApps.framework.filterTable': {
src: './src/Scripts/app/FilterTable/Views/**/*.html',
dest: './src/Scripts/app/FilterTable/Config/templates.js'
},
'smlAppl.webApps.framework.superAdmin': {
src: './src/Scripts/app/superAdmin/views/**/*.html',
dest: './src/Scripts/app/superAdmin/config/templates.js'
}
},
// css
less: {
options: {
sourceMap: true
},
app: {
src: './src/assets/css/mainLocal.less',
dest: rootGitFolder + 'dist/css/main.css'
},
login: {
src: './src/assets/css/loginLocal.less',
dest: rootGitFolder + 'dist/css/login.css'
}
},
cssmin: {
target: {
files: [{
expand: true,
cwd: rootGitFolder + 'dist/css',
src: ['*.css', '!*.min.css'],
dest: rootGitFolder + 'dist/css',
ext: '.min.css',
extDot: 'last'
}]
}
},
// system
// used sync because of file deletion on target
sync: {
less: {
files: [{
//expand: true,
cwd: './src/assets/css',
//src: ['*.less'],
src: ['**', '!mainLocal.less', '!loginLocal.less'],
dest: rootGitFolder + 'less/'
}],
verbose: true, // Default: false
//pretend: true, // Don't do any disk operations - just write log. Default: false
failOnError: true, // Fail the task when copying is not possible. Default: false
updateAndDelete: true,
},
images: {
files: [{
//expand: true,
cwd: './src/assets/images',
//src: ['*.less'],
src: ['**'],
dest: rootGitFolder + 'dist/images/'
}],
verbose: true, // Default: false
//pretend: true, // Don't do any disk operations - just write log. Default: false
failOnError: true, // Fail the task when copying is not possible. Default: false
updateAndDelete: true,
},
},
copy: {
bower: {
src: "bower.json",
dest: rootGitFolder
},
localization: {
files: [{
expand: true,
cwd: 'Localization',
src: ['*.json'],
dest: rootGitFolder + 'localization/'
}]
},
fontawesomeFonts: {
files: [{
expand: true,
cwd: "bower_components/font-awesome/fonts",
src: ["*"],
dest: "dist/fonts/font-awesome"
}]
},
bootstrapFonts: {
files: [{
expand: true,
cwd: "bower_components/bootstrap/fonts",
src: ["*"],
dest: "dist/fonts/bootstrap"
}]
}
//less: {
// files: [{
// expand: true,
// cwd: './src/assets/css',
// //src: ['*.less'],
// src: ['**', '!mainLocal.less', '!loginLocal.less'],
// dest: rootGitFolder + 'less/'
// }]
//},
},
watch: {
scripts: {
files: ['./src/Scripts/app/**/*.js'],
tasks: ['concat', 'uglify']
},
templates: {
files: ['./Views/**/*.html'],
tasks: ['ngtemplates:smlAppl.webApps.framework']
},
templatesFilterTable: {
files: ['./src/FilterTable/Views/**/*.html'],
tasks: ['ngtemplates:smlAppl.webApps.framework.filterTable']
},
templatesSuperAdmin: {
files: ['./src/superAdmin/Views/**/*.html'],
tasks: ['ngtemplates:smlAppl.webApps.framework.superAdmin']
},
less: {
files: ['./src/assets/css/**/*.less'],
tasks: ['less']
},
bower: {
files: ['bower.json'],
tasks: ['copy:bower']
}
}
});
grunt.registerTask('js', ['ngtemplates', 'concat', 'uglify']);
grunt.registerTask('css', ['less', 'cssmin']);
grunt.registerTask('publish', ['concat', 'uglify', 'ngtemplates', 'less', 'cssmin', 'copy', 'sync']);
//grunt.registerTask('default', ['concat', 'uglify', 'ngtemplates', 'less', 'cssmin', 'watch']);
};