This repository has been archived by the owner on Dec 21, 2021. It is now read-only.
/
Gruntfile.js
136 lines (129 loc) · 3.53 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
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
nodemon: {
dev: {
options: {
file: 'server/server.js',
args: ['dev'],
ignoredFiles: ['README.md', 'node_modules/**'],
watchedExtensions: ['js'],
watchedFolders: ['tests'],
debug: false,
delayTime: 1,
env: {
PORT: '1337'
},
cwd: __dirname
}
},
exec: {
options: {
exec: 'sass'
}
}
},
requirejs: {
// mainJS: {
// options: {
// baseUrl: "public/javascripts/",
// paths: {
// "desktop": "app/config/Init"
// },
// wrap: true,
// name: "vendor/almond/almond",
// preserveLicenseComments: false,
// optimize: "uglify",
// mainConfigFile: "public/javascripts/app/config/Init.js",
// include: ["desktop"],
// out: "public/javascripts/app/config/Init.min.js"
// }
// },
mainCSS: {
options: {
optimizeCss: "standard",
cssIn: "./public/stylesheets/app.css",
out: "./public/stylesheets/app.min.css"
}
}
},
jshint: {
files: ['Gruntfile.js', 'public/javascripts/app/**/*.js', '!public/javascripts/app/**/*min.js'],
options: {
globals: {
jQuery: true,
console: false,
module: true,
document: true
}
}
},
mochaTest: {
test: {
options: {
reporter: 'spec'
},
src: ['server/tests/**/*.js']
}
},
shell: {
copyDustJSHelpers: {
command: 'cp -r ./node_modules/dustjs-helpers ./public/javascripts/vendor/'
},
copyFoundationCSS: {
command: 'cp ./public/javascripts/vendor/foundation/css/foundation.css ./public/stylesheets/foundation.css && cp ./public/javascripts/vendor/foundation/css/normalize.css ./public/stylesheets/normalize.css'
},
copyFontAwesomeCSS: {
command: 'cp ./public/javascripts/vendor/font-awesome/css/font-awesome.css ./public/stylesheets/font-awesome.css && cp ./public/javascripts/vendor/font-awesome/css/font-awesome-ie7.css ./public/stylesheets/font-awesome-ie7.css'
},
copyFontAwesomeFonts: {
command: 'cp -r ./public/javascripts/vendor/font-awesome/font/* ./public/font'
}
},
/*
less: {
production: {
options: {
paths: ["public/stylesheets"]
},
files: {
"public/stylesheets/includes/css/custom.css": "public/stylesheets/includes/less/custom.less"
}
}
}
*/
// Custom compile Foundation's SCSS
sass: {
options: {
includePaths: ['public/javascripts/vendor/foundation/scss']
},
dist: {
options: {
outputStyle: 'compressed'
},
files: {
'public/stylesheets/includes/css/custom.css': 'public/stylesheets/includes/scss/custom.scss'
}
}
},
watch: {
grunt: { files: ['Gruntfile.js'] },
sass: {
files: 'public/stylesheets/scss/**/*.scss',
tasks: ['scss']
}
}
});
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('grunt-sass');
grunt.registerTask('test', ['jshint', 'mochaTest' ]);
grunt.registerTask('init', ['shell:copyDustJSHelpers','shell:copyFoundationCSS', 'shell:copyFontAwesomeCSS', 'shell:copyFontAwesomeFonts','sass', 'requirejs:mainCSS']); // 'requirejs:mainJS',
grunt.registerTask('build', ['sass', 'requirejs:mainCSS']); // 'requirejs:mainJS',
grunt.registerTask('server', ['sass','nodemon:dev']);
grunt.registerTask('default', ['init', 'build']); // 'test',
};