-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
92 lines (84 loc) · 2.82 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
module.exports = function(grunt){
//Configuração
grunt.initConfig({
//Minficar JS
uglify: {
options: {
mangle: false
},
//Cria um Arquivo
scripts: {
files: {
//Arquivo de Destino
'static/v3/scripts/application.min.js': [
//Arquivos Inclusos
'static/v3/scripts/_jquery.js',
'static/v3/scripts/_bootstrap.js',
'static/v3/scripts/_dropdown.js',
'static/v3/scripts/_select.js',
'static/v3/scripts/_maskedinput.js',
'static/v3/scripts/_fileupload.js',
'static/v3/scripts/_custom.js'
]
},
options: {
banner: '/*\n***********************\nSmartia: Application JS\nLast Update: <%= grunt.template.today("dd-mm-yyyy") %>\n***********************\n*/\n'
}
},
//Arquivo para o IE
ie: {
files: {
//Arquivo de Destino
'static/v3/scripts/ie8.min.js': [
//Arquivos Inclusos
'static/v3/scripts/_html5.js',
'static/v3/scripts/_respond.js',
'static/v3/scripts/_mediaqueries.js'
]
},
options: {
banner: '/*\n***********************\nSmartia: IE 8 JS\nLast Update: <%= grunt.template.today("dd-mm-yyyy") %>\n***********************\n*/\n'
}
}
},
//Minificar Imagens
imagemin: {
dist: {
options: {
optimizationLevel: 3
},
files: [{
expand: true,
cwd: 'static/v3/images/',
dest: 'static/v3/images/',
src: ['**/*.png', '**/*.jpg']
}],
}
},
//Watch
watch: {
options: {
livereload: true,
},
dist: {
files: [
'static/v3/scripts/*.js',
'static/v3/styles/**/*.css'
],
tasks: ['uglify']
}
}
});
//Plugins do Grunt
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.loadNpmTasks('grunt-contrib-watch');
//Tarefas que serão Executadas
grunt.registerTask('default',
[
'uglify'
]
);
grunt.registerTask('w', ['watch']);
grunt.registerTask('i', ['imagemin']);
};