-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGruntfile.js
More file actions
68 lines (54 loc) · 1.65 KB
/
Gruntfile.js
File metadata and controls
68 lines (54 loc) · 1.65 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
var FrontendScript = require('./dev/frontend_script');
module.exports = function(grunt) {
// Front-end scripts
var frontendScript = new FrontendScript(grunt);
frontendScript.viewScripts = {
// Fullfill features
'public/js/fulfill.js': [ 'frontend/js/fulfill.js' ],
// Javascript for homepage
'public/views/index.js': [ 'frontend/views/index.js' ],
// JavaScript file for user pages
'public/views/user/forget.js': [ 'frontend/views/user/forget.js' ],
'public/views/user/profile.js': [ 'frontend/views/user/profile.js' ],
'public/views/user/reset_password.js': [ 'frontend/views/user/reset_password.js' ],
'public/views/user/signin.js': [ 'frontend/views/user/signin.js' ],
'public/views/user/signup.js': [ 'frontend/views/user/signup.js' ],
// JavaScript files for admin Pages
'public/views/admin/index.js': [ 'frontend/views/admin/index.js' ]
};
frontendScript.updateSources();
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
uglify: {
view: {
files: frontendScript.gruntSettings
}
},
watch: {
scripts: {
files: frontendScript.watchScripts,
tasks: 'uglify:view'
},
options: {
nospawn: true
}
}
});
grunt.event.on('watch', function(action, filepath) {
frontendScript.watch(action, filepath);
});
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('build', [
'uglify:view'
]);
grunt.registerTask('debug', function() {
var child = grunt.util.spawn({
cmd: 'node',
args: [ grunt.config('pkg.main') ]
});
child.stdout.pipe(process.stdout);
child.stderr.pipe(process.stderr);
grunt.task.run('watch');
});
};