-
Notifications
You must be signed in to change notification settings - Fork 20
/
Gruntfile.js
48 lines (47 loc) · 1.55 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
module.exports = function(grunt){
grunt.initConfig({
requirejs: {
options: {
baseUrl: 'src',
name: '../node_modules/almond/almond',
mainConfigFile: './src/config.js',
include: ['main'],
wrap: {
startFile: 'src/wrap/start.js',
endFile: 'src/wrap/end.js'
}
},
production: {
options: {
optimizeAllPluginResources: true,
optimize: 'uglify2',
out: "release/elegans.min.js"
}
},
development: {
options: {
optimize: "none",
out: "release/elegans.js"
}
}
},
shell: {
make_shader: {
command: "\
cd ./src/shaders;\
for file in *.glsl; do\
c=`cat \"${file}\"`;\
c=`echo \"$c\" | sed -e \"s/$/__terminate__\\\\\\\\\\\\/g\"`\
c=\"define(function(){return \\\"$c\n\\\".replace(\/__terminate__\/g, \\\"\\\\\\n\\\");});\";\
fname=\`echo ${file} | sed -e s/.glsl/.js/g\`;\
echo \"$c\" > $fname;\
done"
}
}
});
grunt.loadNpmTasks("grunt-contrib-requirejs");
grunt.loadNpmTasks("grunt-shell");
grunt.registerTask("default", ["release"]);
grunt.registerTask("deploy", ["shell:make_shader", "requirejs"]);
grunt.registerTask("release", ["deploy"]);
};