-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
97 lines (87 loc) · 2.19 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
module.exports = function(grunt) {
'use strict';
// Project configuration.
grunt.initConfig({
// Empty directories before build process
clean: {
css: ["dist/*.css", "dist/*.css.map"],
js: ["dist/*.js", "dist/*.js.map"]
},
// Use Uglify to bundle up a pym file for the home page
uglify: {
options: {
sourceMap: true
},
homepage: {
files: {
'dist/scripts.js': [
'source/javascripts/vendor/jquery.js',
'source/javascripts/vendor/underscore.js',
'source/javascripts/vendor/backbone.js',
'source/javascripts/main.js',
'source/javascripts/models/meme.js',
'source/javascripts/views/meme-canvas.js',
'source/javascripts/views/meme-editor.js',
'source/javascripts/helpers/font-monitor.js',
'source/javascripts/settings.js'
]
}
}
},
// Transpile SASS
sass: {
dist: {
options: {
style: 'compressed',
compass: true
},
files: {
'dist/styles.css': 'source/stylesheets/main.scss'
}
}
},
// watch locations
watch: {
options: {
livereload: true,
},
scripts: {
files: ['source/**/*.js'],
tasks: ['uglify']
},
styles: {
files: ['source/**/*.scss'],
tasks: ['sass']
},
markup: {
files: ['index.html']
}
},
// Creating a local server
connect: {
server: {
options: {
hostname: '0.0.0.0',
base: './',
keepalive: true,
livereload: true,
open: true
}
}
},
concurrent: {
options: {
logConcurrentOutput: true
},
dev: ['connect', 'watch']
}
});
// Load the task plugins
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-concurrent');
grunt.registerTask('default', ['clean', 'sass', 'uglify', 'concurrent']);
};