-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
104 lines (98 loc) · 3.15 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
project: {
app: 'app'
},
connect: {
options: {
port: 9000,
livereload: true,
// livereload: 35729,
// Change this to '0.0.0.0' to access the server from outside
hostname: 'localhost'
},
livereload: {
options: {
open: true,
base: [
'.tmp',
'<%= project.app %>'
]
}
},
},
watch: {
html: {
files: [
'<%= project.app %>/views/{,*/}*.html'
]
},
javascript: {
files: [
'<%= project.app %>/javascripts/{,*/}*.js'
],
tasks: ['jshint']
},
compass: {
files: [
'<%= project.app %>/styles/{,*/}*.scss'
],
tasks: ['compass:dev']
},
gruntfile: {
files: ['Gruntfile.js']
},
// options: {
// livereload: true,
// },
livereload: {
options: {
livereload: '<%= connect.options.livereload %>'
},
files: [
'<%= project.app %>/views/{,*/}*.html',
'<%= project.app %>/styles/{,*/}*.{css,scss}',
'<%= project.app %>/javascripts/{,*/}*.js',
'<%= project.app %>/images/{,*/}*.{gif,jpeg,jpg,png,svg,webp}'
]
},
},
compass: {
dev: {
options: {
sassDir: '<%= project.app %>/styles',
cssDir: '<%= project.app %>/styles',
imagesDir: '<%= project.app %>/images',
importPath: '<%= project.app %>/bower_components',
environment: 'development'
}
},
prod: {
options: {
sassDir: '<%= project.app %>/styles',
cssDir: '<%= project.app %>/styles',
imagesDir: '<%= project.app %>/images',
importPath: '<%= project.app %>/bower_components',
environment: 'production'
}
},
},
jshint: {
files: [
'gruntfile.js',
'<%= project.app %>/javascripts/{,*/}*.js'
]
}
});
// Load the plugin
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-jshint');
// Default task(s).
grunt.registerTask('default', ['connect:livereload', 'compass:dev', 'jshint', 'watch']);
// prod build
grunt.registerTask('prod', ['compass:prod']);
};