forked from alex-milanov/gradame-meanjs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Gruntfile.js
102 lines (88 loc) · 2.51 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
module.exports = function(grunt) {
grunt.initConfig({
lintspaces: {
all: {
src: [
'*',
'app/**/*',
'config/**/*',
'public/css/**/*',
'public/js/**/*',
'public/views/**/*'
],
filter: 'isFile',
options: {
newline: true,
newlineMaximum: 2,
trailingspaces: true,
indentation: 'spaces',
spaces: 2
}
},
},
trimtrailingspaces: {
main: {
src: [
'*',
'app/**/*',
'config/**/*',
'public/css/**/*',
'public/js/**/*',
'public/views/**/*'
],
filter: 'isFile',
options: {
encoding: 'utf8',
failIfTrimmed: false
}
}
},
exec: {
tabs2spaces: 'find . \\\( -name "*.js" -o -name "*.html" -o -name "*.css" -o -name "*.jade" -o -name "*.json" \\\) ' +
'-not \\\( -type d -o -path "./public/lib/*" -o -path "./node_modules/*" -o -path "./.vagrant/*" -o -path "./.git/*" \\\) ' +
'-exec bash -c \'expand -t 2 "$0" > /tmp/e && mv /tmp/e "$0"\' {} \\\;',
spaces2tabs: 'find . \\\( -name "*.js" -o -name "*.html" -o -name "*.css" -o -name "*.jade" -o -name "*.json" \\\) ' +
'-not \\\( -type d -o -path "./public/lib/*" -o -path "./node_modules/*" -o -path "./.vagrant/*" -o -path "./.git/*" \\\) ' +
'-exec bash -c \'unexpand -t 2 "$0" > /tmp/e && mv /tmp/e "$0"\' {} \\\;',
npmInstall: 'npm install',
bowerInstall: 'bower install'
},
sass: {
dist: {
files: {
'public/css/style.css' : 'public/css/style.scss'
}
}
},
watch: {
css: {
files: '**/*.scss',
tasks: ['sass']
}
},
nodemon: {
dev: {
script: 'server.js',
options: {
args: [],
ignore: ['node_modules/**','public/**'],
ext: 'js,html',
//nodeArgs: ['--debug'],
delayTime: 1,
cwd: __dirname
}
}
},
concurrent: {
tasks: ['nodemon', 'watch'],
options: {
logConcurrentOutput: true
}
}
});
require('load-grunt-tasks')(grunt);
grunt.registerTask('check-spaces', ['lintspaces']);
grunt.registerTask('fix-spaces', ['trimtrailingspaces', 'exec:tabs2spaces']);
grunt.registerTask('default',['sass','concurrent']);
grunt.registerTask('install',['exec:npmInstall','exec:bowerInstall']);
};