-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
100 lines (94 loc) · 2.33 KB
/
Gruntfile.js
File metadata and controls
100 lines (94 loc) · 2.33 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
'use strict';
var LIVERELOAD_PORT = 35729;
var lrSnippet = require( 'connect-livereload' )({ port: LIVERELOAD_PORT });
var mountFolder = function ( connect, dir ) {
return connect.static( require( 'path' ).resolve( dir ) );
};
module.exports = function(grunt) {
grunt.initConfig({
watch: {
options: {
nospawn: true,
livereload: LIVERELOAD_PORT
},
css: {
files: 'src/css/*.scss',
tasks: ['sass']
},
livereload: {
files: [
'index.html',
'src/**/*'
],
tasks: [ 'build' ]
}
},
jshint: {
files: ['src/js/**/*.js', 'src/js/*.js'],
options: {
globals: {
//jQuery: true,
//angular: true
}
}
},
jasmine : {
src : ['dist/slideshow.js'],
options : {
specs : 'src/js/tests/slideshow-specs.js'
}
},
sass: {
dist: {
files: {
'dist/slideshow.css' : 'src/css/compiled/compiled-sass.scss'
}
}
},
concat: {
js: {
src: ['src/js/slideshow.js', 'src/js/second.js'],
dest: 'dist/slideshow.js'
},
css: {
src: ['src/css/template.scss', 'src/css/!(template)*.scss'],
dest: 'src/css/compiled/compiled-sass.scss'
}
},
open: { //not added to dependencies yet <<<<<<<<<<<<<<<<<<<<<<<<<<
server: {
path: 'http://localhost:<%= connect.options.port %>'
}
},
connect: { //not added to dependencies yet <<<<<<<<<<<<<<<<<<<<<<<<<<
options: {
port: 9000,
// change this to '0.0.0.0' to access the server from outside
hostname: 'localhost'
},
livereload: {
options: {
middleware: function ( connect ) {
return [
lrSnippet,
mountFolder( connect, '.' )
];
}
}
}
},
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jasmine');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-concat');
//grunt.loadNpmTasks('');
// Default task(s).
grunt.registerTask('build', [ 'jshint', 'concat', 'sass' ]);
grunt.registerTask('server', ['connect:livereload', 'open', 'watch' ] );
grunt.registerTask('default', ['build']);
};