-
Notifications
You must be signed in to change notification settings - Fork 9
/
gruntfile.js
executable file
·54 lines (52 loc) · 1.77 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
module.exports = function (grunt) {
grunt.initConfig({
nunjucks: {
precompile: {
baseDir: 'templates/shared/',
src: ['templates/shared/*', '!templates/shared/about.jinja2', '!templates/shared/terms.jinja2', '!templates/shared/privacy.jinja2'],
dest: 'static/js/templates.js',
options: {
// env: require('./nunjucks-environment'),
name: function (filename) {
return filename;
// return filename.substring(filename.lastIndexOf("/") + 1, filename.lastIndexOf("."));
}
}
}
},
watch: {
nunjucks: {
files: ['templates/shared/*', '!templates/shared/about.jinja2', '!templates/shared/about.jinja2', '!templates/shared/terms.jinja2', '!templates/shared/privacy.jinja2'],
tasks: ['nunjucks']
},
less: {
files: "static/less/*",
tasks: ["less"]
}
},
less: {
dist: {
files: {
'static/css/style.css': ['static/less/main.less']
},
options: {
sourceMap: true,
sourceMapFilename: 'static/css/style.css.map',
sourceMapBasepath: '/',
sourceMapRootpath: '/'
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-nunjucks');
grunt.registerTask('compile', [
'nunjucks',
'less',
'watch'
]);
grunt.registerTask('default', [
'compile'
]);
};