This repository has been archived by the owner on Aug 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Gruntfile.js
91 lines (78 loc) · 2.27 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
//Read the package.json (optional)
pkg: grunt.file.readJSON('package.json'),
// Metadata.
meta: {
basePath: './',
srcPath: './public/sass/',
deployPath: './public/assets/css/',
bowerPath: './public/assets/bower_components/'
},
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'* Copyright (c) <%= grunt.template.today("yyyy") %> ',
// Task configuration.
connect: {
server: {
options: {
port: 8080,
base: './public'
}
}
},
karma: {
unit: {
configFile: 'karma.conf.js',
autoWatch: false,
background: true
}
},
sass: {
dist: {
options: {
style: 'compressed',
loadPath: ['<%= meta.bowerPath %>foundation/scss/', '<%= meta.bowerPath %>foundation/scss/foundation/components/']
},
files: {
'<%= meta.deployPath %>main.css': '<%= meta.srcPath %>main.scss'
}
}
},
uglify: {
options: {
mangle: false
},
my_target: {
files: {
'public/assets/js/angular_drums.min.js': ['public/assets/bower_components/angular-route/angular-route.min.js', 'public/assets/bower_components/howler/howler.min.js', 'public/app/**/*.js']
}
}
},
watch: {
sasstocss: {
files: ['<%= meta.srcPath %>/**/*.scss'],
tasks: ['sass']
},
/* watch and see if our javascript files change, or new packages are installed */
js: {
files: ['public/app/**/*.js'],
tasks: ['uglify']
},
karma: {
files: ['public/app/**/*.js', 'test/**/*.js'],
tasks: ['karma:unit:run']
}
}
});
// These plugins provide necessary tasks.
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-karma');
// Default task.
grunt.registerTask('build', ['sass', 'uglify']);
grunt.registerTask('dev', ['build', 'karma:unit:start', 'connect', 'watch']);
};