forked from h10r/kth-expense-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
132 lines (124 loc) · 3.55 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
module.exports = function (grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
distApp: {
// the files to concatenate
src: ['src/scripts/*.js'],
// the location of the resulting JS file
dest: 'public/js/app.js'
},
distControllers: {
// the files to concatenate
src: ['src/scripts/controllers/*.js'],
// the location of the resulting JS file
dest: 'public/js/controllers.js'
},
distDirectives: {
// the files to concatenate
src: ['src/scripts/directives/*.js'],
// the location of the resulting JS file
dest: 'public/js/directives.js'
},
distServices: {
// the files to concatenate
src: ['src/scripts/services/*.js'],
// the location of the resulting JS file
dest: 'public/js/services.js'
},
},/*
uglify: {
options: {
mangle: false
},
buildControllers: {
src: 'tmp/js/controllers.concat.js',
dest: 'build/js/controllers.concat.min.js'
},
buildModels: {
src: 'tmp/js/models.concat.js',
dest: 'build/js/models.concat.min.js'
},
buildDirectives: {
src: 'tmp/js/directives.concat.js',
dest: 'build/js/directives.concat.min.js'
},
buildMainJs: {
src: 'src/js/app.js',
dest: 'build/js/app.min.js'
},
},*/
sass: { // Task
dist: { // Target
options: { // Target options
style: 'compressed'
},
files: { // Dictionary of files
'public/css/app.css': 'src/styles/app.scss' // 'destination': 'source'
},
},
},
copy: {
main: {
files: [
{expand: true, cwd: 'src/', src: ['views/*.html'], dest: 'public/', filter: 'isFile'},
// copy font files manually (bower-concat doesn't do it)
{expand: true, cwd: 'bower_components/fontawesome/', src: ['fonts/*'], dest: 'public/', filter: 'isFile'},
{expand: true, cwd: 'bower_components/ratchet/', src: ['fonts/*'], dest: 'public/', filter: 'isFile'},
{src: ['src/index.html'], dest: 'public/index.html'},
],
},
},
bower_concat: {
all: {
dest: 'public/js/bower.js',
cssDest: 'public/css/bower.css',
exclude: [
],
dependencies: {
},
bowerOptions: {
relative: false
},
},
},
jshint: {
beforeconcat: ['src/scripts/**/*.js', 'server.js'],
afterconcat: ['build/*.js']
},
watch: {
scripts: {
files: ['src/scripts/**/*.js'],
tasks: ['jshint', 'concat', 'copy'],
options: {
spawn: false,
},
},
html: {
files: ['src/**/*.html'],
tasks: ['copy'],
options: {
spawn: false,
},
},
styles: {
files: ['src/styles/*.scss'],
tasks: ['sass'],
options: {
spawn: false,
},
}
},
});
// Load the plugin that provides the "uglify" task.
grunt.loadNpmTasks('grunt-bower-concat');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task(s).
grunt.registerTask('default', ['concat', 'jshint', /*'uglify',*/ 'sass', 'copy', 'bower_concat']);
};