-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntFile.js
More file actions
74 lines (70 loc) · 2.06 KB
/
Copy pathGruntFile.js
File metadata and controls
74 lines (70 loc) · 2.06 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
69
70
71
72
73
74
/*
* Grunt file for overide projects with projects !
* Useful for develop and override projects without touching sources
* Eg, need to modify a legacy project which not provides modules or extensions
*
*/
module.exports = function (grunt) {
// Grunt configuration goes into initConfig
grunt.initConfig({
conf: grunt.file.readJSON('conf.json'),
copy: {
main: {
cwd: '<%= conf.override %>',
src: ['**'],
dest: '<%= conf.project %>',
expand: true
},
dev: {
cwd: '<%= conf.override %>/dist-dev',
src: ['**'],
dest: '<%= conf.override %>/dist',
expand: true
}
},
run: {
dev_server_osjs: {
options: {
cwd: './osjs/bin'
},
cmd: 'win-start-dev.cmd'
}
},
subgrunt: {
grunt_watch_osjs: {
options: {
npmInstall: false
},
projects: {
'osjs': 'watch'
}
}
},
watch: {
copy: {
files: ['<%= conf.override %>/**'],
tasks: ['copy:main', 'copy:dev'],
options: {
spawn: false
}
}
},
concurrent: {
osjs_dev: {
tasks: ['watch', 'run:dev_server_osjs', 'subgrunt:grunt_watch_osjs'],
options: {
logConcurrentOutput: true
}
}
}
});
// Next one would load plugins
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-concurrent');
grunt.loadNpmTasks('grunt-subgrunt');
grunt.loadNpmTasks('grunt-run');
// Here is where we would define our task
grunt.registerTask('build', ['copy']);
grunt.registerTask('dev', ['concurrent:osjs_dev']);
};