-
Notifications
You must be signed in to change notification settings - Fork 3
/
Gruntfile.js
156 lines (141 loc) · 3.46 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/**
* Installation:
* 1. Install Grunt CLI (`npm install -g grunt-cli`)
* 1. Install Grunt 0.4.0 and other dependencies (`npm install`)
*
* Build:
* Execute `grunt` from root directory of this directory (where Gruntfile.js is)
* To execute automatically after each change, execute `grunt --force default watch`
* To execute build followed by the test run, execute `grunt test`
*
* See http://gruntjs.com/getting-started for more information about Grunt
*/
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
html2js: {
templates: {
options: {
module: 'gradeBookApp.templates', // ANGULAR MODULE NAME
base: 'src/app/modules/', // REMOVE PATH FROM FILE
htmlmin: {
//collapseWhitespace: true
//removeComments: true
}
},
dest: 'tmp/commonDirectives.js',
src: [
'src/app/modules/gradebook/*.html'
]
}
},
sass: {
dist: {
files: {
'dist/css/style.css': 'src/scss/style.scss'
}
}
},
copy: {
index: {
files: [
{
src: 'src/index.html',
dest: 'dist/index.html'
}
]
},
main: {
files: [
{
expand: true,
cwd: 'src/lib/',
src: ['**'],
dest: 'dist/lib/'
}
]
}
},
app: {
all: [
'src/app/modules/gradebook/*.js',
'src/app/services/*.js'
]
},
concat: {
dist: {
files: {
'dist/app/gradebook.js': [
'src/app/gradebook.js',
'<%= app.all %>',
'tmp/commonDirectives.js'
]
}
}
},
uglify: {
my_target: {
options: {
mangle: false
},
files: {
'dist/app/gradebook.min.js': ['dist/app/gradebook.js']
}
}
},
watch: {
options: {
livereload: true //works with Chrome LiveReload extension. See: https://github.com/gruntjs/grunt-contrib-watch
},
files: [
'src/*.html',
'src/scss/*.scss',
'src/app/modules/**/**/*.html',
'src/app/modules/**/**/*.js',
'src/app/*.js',
'src/app/**/*.js',
'src/app/**/**/*.js',
'src/app/**/**/**/*.js',
'src/app/**/**/*.html'
],
tasks: ['default']
},
clean: {
dist: ['tmp']
},
replace: {
dist: {
options: {
variables: {
version: "<%= pkg.version %>",
timestamp: "<%= (new Date()).toString() %>"
}
}
}
},
connect: {
dev: {
options: {
port: 9876,
hostname: "0.0.0.0",
base: "dist",
keepalive: true
}
}
}
}
);
// DEFAULT TASKS
grunt.registerTask('default', [
"html2js",
"sass",
"concat",
"clean"
]);
grunt.loadNpmTasks('grunt-html2js');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
};