-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
109 lines (103 loc) · 2.33 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
(function(_build) {
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options: {
jshintrc: true
},
all: ['Gruntfile.js', 'src/**/*.js'],
core: ['src/core/**/*.js'],
},
uglify: {
build: {
src: 'tmp/all.js',
dest: 'build/all.min.js'
}
},
clean: ['build', 'tmp'],
copy: {
index: {
src: 'src/index.html',
dest: 'build/index.html'
},
res: {
files: [{
expand: true,
cwd: 'src/res',
src: '**',
dest: 'build/res/',
filter: 'isFile'
}]
},
worker: {
src: 'src/worker.js',
dest: 'build/worker.js'
},
owdjs: {
src: 'src/owdAppLoader.js',
dest: 'build/owdAppLoader.js'
},
owdappjs: {
src: 'src/js/owdapp.js',
dest: 'build/owdapp.js'
}
},
requirejs: {
compile: {
options: {
baseUrl: "src",
mainConfigFile: "src/config.js",
name: 'core/owd',
out: "build/owd.min.js",
include: ['../bower_components/requirejs/require.js']
}
}
},
concat: {
options: {
separator: ';',
},
dist: {
src: ['bower_components/requirejs/require.js', 'tmp/owd.min.js'],
dest: 'tmp/all.js',
},
},
watch: {
theme: {
files: ['src/themes/**'],
tasks: ['theme']
},
index: {
files: ['src/index.html'],
tasks: ['copy:index']
},
loader: {
files: ['src/owdAppLoader.js'],
tasks: ['copy:owdjs']
},
worker: {
files: ['src/worker.js'],
tasks: ['copy:worker']
},
core: {
files: ['src/core/**'],
tasks: ['jshint:core', 'requirejs']
}
},
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('theme', 'build themes', function() {
_build.buildThemes();
});
// Default task(s).
grunt.registerTask('default', ['clean', 'requirejs', 'copy', 'theme']);
};
})(require('./build.js'));