forked from timhettler/sassconf-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
74 lines (64 loc) · 1.69 KB
/
Copy pathGruntfile.js
File metadata and controls
74 lines (64 loc) · 1.69 KB
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
'use strict';
module.exports = function (grunt) {
// Loads in any grunt tasks in the package.json file
// https://github.com/sindresorhus/load-grunt-tasks
require('load-grunt-tasks')(grunt);
var taskConfig = {
// Clear files and folders
// https://github.com/gruntjs/grunt-contrib-clean
clean: {
demo: ['demo/styles'],
test: ['test/output']
},
// Run tasks whenever watched files change
// https://github.com/gruntjs/grunt-contrib-watch
watch: {
sass: {
options: {
livereload: true
},
files: ['sass/**/*.scss'],
tasks: ['sass'],
}
},
// Start a static web server.
// https://github.com/gruntjs/grunt-contrib-connect
connect: {
options: {
port: 9000,
livereload: 35729,
hostname: 'localhost'
},
demo: {
options: {
open: true,
base: ['demo']
}
}
},
// Compile Sass to CSS using node-sass
// https://github.com/sindresorhus/grunt-sass
sass: {
demo: {
files: {
'demo/styles/app.css': 'sass/app.scss'
}
}
},
// Run Mocha tests
// https://github.com/jamescarr/grunt-mocha-cli
mochacli: {
all: ['test/test_shim.js']
},
// Create documentation with SassDoc
// https://github.com/SassDoc/grunt-sassdoc
sassdoc: {
src: 'sass/'
}
};
grunt.initConfig(taskConfig);
grunt.registerTask('test', ['clean:test', 'mochacli']);
grunt.registerTask('server', ['clean:demo', 'sass:demo', 'connect:demo', 'watch']);
grunt.registerTask('noserver', ['clean:demo', 'sass:demo', 'watch']);
grunt.registerTask('default', ['server']);
};