/
Gruntfile.js
90 lines (84 loc) · 2.66 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
var path = require('path');
module.exports = function(grunt) {
grunt.initConfig({
handlebars: {
compile: {
files: {
"./js/templates.js": [
"./templates/*.handlebars",
"./templates/*/*.handlebars"
]
},
options: {
amd: false,
namespace: "Handlebars.templates",
processName: function (filePath) {
return path.basename(filePath, '.handlebars');
},
partialsUseNamespace: true,
processPartialName: function (filePath) {
return path.basename(filePath, '.handlebars');
},
partialRegex: /^par_/
}
}
},
uglify: {
js: {
files: {
'./js/lib.min.js': [
'./js/lib/*.js'
],
'./js/custom.min.js': [
'./js/controllers/*.js',
'./js/templates.js',
'./js/config.js',
'./js/app.js',
'./js/routes.js',
'./js/translations/*.js'
]
}
}
},
/*less: {
production: {
options: {
paths: ['./css']
},
files: {
'./css/style.css': './css/style.less'
}
}
},
sass: {
dist: {
files: {
'./css/style.css': './css/style.scss'
}
}
},*/
watch: {
scripts: {
files: [
'./templates/*.handlebars',
"./templates/*/*.handlebars",
'./js/lib/*.js',
'./js/controllers/*.js',
'./js/templates.js',
'./js/config.js',
'./js/routes.js',
'./js/app.js',
'./js/translations/*.js'
//'./css/style.less'
],
tasks: ['default']
}
}
});
grunt.registerTask('default', ['handlebars', 'uglify']);
grunt.loadNpmTasks('grunt-contrib-handlebars');
grunt.loadNpmTasks('grunt-contrib-uglify');
//grunt.loadNpmTasks('grunt-contrib-less');
//grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
}