forked from squarefeet/ShaderParticleEngine
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Gruntfile.js
56 lines (45 loc) · 1.83 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
module.exports = function( grunt ) {
var packageJSON = grunt.file.readJSON('package.json');
var licenseBanner = '/* ' + packageJSON.name + ' ' + packageJSON.version + '\n' +
' * ' + '\n' +
' * (c) 2013 Luke Moody (http://www.github.com/squarefeet) & Lee Stemkoski (http://www.adelphi.edu/~stemkoski/)' + '\n' +
' * Based on Lee Stemkoski\'s original work (https://github.com/stemkoski/stemkoski.github.com/blob/master/Three.js/js/ParticleEngine.js).' + '\n' +
' *' + '\n' +
' * ' + packageJSON.name + ' may be freely distributed under the MIT license (See LICENSE.txt at root of this repository.)' + '\n */\n';
// Specify input files and output paths
var files = [
'src/ShaderParticleGroup.js',
'src/ShaderParticleEmitter.js'
],
outputPath = 'build/ShaderParticles.js',
outputPathMin = outputPath.replace( '.js', '.min.js' );
var uglifySettings = {
min: {
options: {
mangle: true,
compress: {
dead_code: true,
},
banner: licenseBanner
},
files: {}
}
};
// Set the path for where the minified files should be saved
uglifySettings.min.files[ outputPathMin ] = [ outputPath ];
grunt.initConfig({
uglify: uglifySettings,
concat: {
options: {
separator: ';\n\n'
},
dist: {
src: files,
dest: outputPath,
},
}
});
grunt.loadNpmTasks( 'grunt-contrib-concat' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.registerTask( 'default', ['concat', 'uglify'] );
};