-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
65 lines (59 loc) · 1.93 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
'use strict';
/*
* GRUNT.JS is automated task runner for projects.
* it runs a server, compiles .less stylesheets, and
* performs any other repetitive tasks. (http://gruntjs.com/)
*/
/*
* This project contains the following Grunt Plugins:
* 1. grunt less compiler (https://github.com/gruntjs/grunt-contrib-less)
* 2. watch for file changes (https://github.com/gruntjs/grunt-contrib-watch)
* 3. run a connect middleware server (https://github.com/gruntjs/grunt-contrib-connect)
*/
// project configuration.
module.exports = function(grunt) {
grunt.initConfig({
less: {
development: {
files:{
"css/styles.css" : "css/less/styles.less"
}
}
},
watch: {
options: {
livereload: true //reload the files after changes are made
},
styles: {
// Which files to watch (all .less files recursively in the less directory)
files: ['css/less/*.less'],
tasks: ['less'],
options: {
nospawn: true,
reload: true
}
}
},
// Creates a connect server on nodejs for serving all the files
connect: {
'static': {
options: {
hostname: 'localhost',
port: 7000
}
},
server: {
options: {
hostname: 'localhost',
port: 7001
}
}
}
});
// Load all of our grunt.js tasks
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
// run the following tasks at once by typing `grunt server` into the command prompt
grunt.registerTask('server', ['connect:static', 'connect:server', 'watch']);
};