forked from amwmedia/angular-workshop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
101 lines (86 loc) · 2.48 KB
/
Gruntfile.js
File metadata and controls
101 lines (86 loc) · 2.48 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
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
'use strict';
module.exports = function (grunt) {
// Load grunt tasks automatically
require('load-grunt-tasks')(grunt);
// Define the configuration for all the tasks
grunt.initConfig({
// define project-specific settings (grunt templates)
ng: {
app: 'app',
temp: '.tmp'
},
// empty folders to start fresh
clean: {
dev: '<%= ng.temp %>'
},
stylus: {
compile: {
options: {
compress: false,
linenos: true,
paths: ['<%= ng.app %>/styl']
},
files: {
'<%= ng.temp %>/stylus.css': '<%= ng.app %>/styl/*.styl'
}
}
},
autoprefixer: {
options: {
// Task-specific options go here.
browsers: ['last 2 version', 'ie 8', 'ie 9']
},
// prefix the specified file
main: {
src: '<%= ng.temp %>/stylus.css',
dest: '<%= ng.app %>/css/main.css'
}
},
// start static web server
connect: {
options: {
hostname: 'localhost',
port: 9000,
livereload: 35729
},
dev: {
options: {
open: true,
base: [
'<%= ng.temp %>',
'<%= ng.app %>'
]
}
}
},
// watch files for changes and run tasks based on the changed files
watch: {
options: {
spawn: false,
livereload: true
},
// reload the browser when changes are made
livereload: {
files: [
'<%= ng.app %>/**/*.html',
'<%= ng.app %>/css/main.css',
'<%= ng.app %>/**/*.js'
]
},
// compile CSS when Sass files are changed
stylus: {
files: ['<%= ng.app %>/**/*.styl'],
tasks: ['stylus', 'autoprefixer', 'clean:dev']
}
}
});
// run development instance
grunt.registerTask('dev', function (target) {
grunt.task.run([
'clear',
'clean:dev',
'connect:dev',
'watch'
]);
});
};