-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgruntfile.js
100 lines (93 loc) · 3.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
92
93
94
95
96
97
98
99
100
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
//pkg: grunt.file.readJSON('package.json'),
copy: {
html: {
files: [
{ expand: true,
cwd: 'resources/client/html/',
flatten: true, //copy without subdirectories
src: ['**'],
dest: 'public/',
filter: 'isFile'
}
]
},
js: {
files: [
{ expand: true,
cwd: 'resources/client/js/',
flatten: true, //copy without subdirectories
src: ['*.min.js'],
dest: 'public/js/',
filter: 'isFile'
}
]
}
},
concat: {
options: {
separator: ';', //good if minified
sourceMap: true
},
tkvrJs: {
src: [ 'resources/client/js/tkvr-main-module.js',
'resources/client/js/tkvr-list-ctrl.js',
'resources/client/js/tkvr-view-ctrl.js',
'resources/client/js/tkvr-orientation.js',
'resources/client/js/tkvr-control-pointer-coords.js',
'resources/client/js/tkvr-fullscreen.js',
'resources/client/js/tkvr-socket-io-setup.js',
'resources/client/js/tkvr-control.js',
'resources/client/js/tkvr-control-button.js',
'resources/client/js/tkvr-control-slider.js',
'resources/client/js/tkvr-control-xy-pad.js',
'resources/client/js/tkvr-anim-expand.js'
],
dest: 'public/js/tkvr.js'
}
},
sass: {
compile: {
files: [{
expand: true,
cwd: 'resources/client/sass/',
src: ['main.scss'],
dest: 'public/css/',
ext: '.css'
}]
}
},
watch: {
html: {
files: ['resources/client/html/*.html'],
tasks: ['copy:html'],
options: {
spawn: false
}
},
sass: {
files: ['resources/client/sass/*.scss'],
tasks: ['sass:compile'],
options: {
spawn: false
}
},
js: {
files: ['resources/client/js/tkvr-*.js'],
tasks: ['concat:tkvrJs'],
options: {
spawn: false
}
}
}
});
// Load the plugins
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
// Default task(s).
//grunt.registerTask('publicWatcher', ['watch:html', 'watch:sass', 'watch:js']); //does not work, need extra task to watch multiple
};