This repository has been archived by the owner on Apr 5, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
/
Gruntfile.js
58 lines (52 loc) · 1.56 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
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
server: {
options: {
port: 9000,
base: '.'
}
}
},
optimize: {
'engine': 'Engine',
'bpmn' : 'Bpmn'
},
watch: {
files: 'src/**/*',
tasks: [ 'optimize' ]
},
requirejs: {
compile: {
options: {
name : "bpmn/<%= grunt.config.get('optimizeName') %>",
baseUrl: "./",
paths: {
"dojox/gfx": "empty:",
"jquery": "empty:"
},
packages: [
{ name: "dojo", location: "lib/dojo/dojo" },
{ name: "dojox", location: "lib/dojo/dojox"},
{ name: "bpmn", location: "src/bpmn"}],
out: "build/<%= grunt.config.get('optimizeName').toLowerCase() %>.min.js"
}
}
}
});
// r.js optimizer for requirejs will not work for the renderer, because there are circular dependencie in dojo
// we will need to use the dojo build tool to create a single file build for that
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks( 'grunt-contrib-connect');
grunt.loadNpmTasks( 'grunt-contrib-watch' );
// Default task(s).
grunt.registerTask( 'default', [ 'optimize' ]);
grunt.registerTask( 'server', [ 'connect:server'] );
grunt.registerMultiTask( 'optimize', 'optimize the project', function() {
var name = this.data;
grunt.config.set('optimizeName', name);
grunt.task.run('requirejs');
});
};