diff options
| author | Julie Lala <jules@okfoc.us> | 2014-01-29 09:31:53 -0500 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2014-01-29 09:31:53 -0500 |
| commit | 219aad8ea57538868c6735860dbcc0873f62dcd8 (patch) | |
| tree | 2cc691da2fe6a0c5c6ae75ad80920fc74d66f809 /Gruntfile.js | |
| parent | 0aa06bbe84961b9393029f904bc7a49e79b513f4 (diff) | |
grunt build process for worker
Diffstat (limited to 'Gruntfile.js')
| -rw-r--r-- | Gruntfile.js | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..232ec16 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,61 @@ +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + concat: { + options: { + separator: ';' + }, + worker: { + src: [ + 'js/worker/GIFEncoder.js', + 'js/worker/LZWEncoder.js', + 'js/worker/NeuQuant.js', + 'js/worker/worker.js', + ], + dest: 'js/worker.concat.js' + }, + client: { + src: [ + 'js/client/worker.min.js', + 'js/client/util.js', + 'js/client/tube.js', + 'js/client/client.js', + ], + dest: 'js/client.concat.js', + }, + }, + uglify: { + worker: { + options: { + banner: "var workerURL = URL.createObjectURL( new Blob([ '(',function(){", + footer: "}.toString(),')()' ], { type: 'application/javascript' } ) )", + }, + src: 'js/worker.concat.js', + dest: 'js/worker.min.js' + }, + client: { + options: { + banner: '/* asdf.us/gif-recorder */\n' + }, + src: 'js/client.concat.js', + dest: 'dist/gif-encode.min.js' + }, + }, + watch: { + files: ['js/!(live.min|live.concat).js','js/record.js'], + tasks: ['default'] + } + }); + + // Load tasks that we'll be using + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-watch'); + + // Default task(s). + grunt.registerTask('worker', ['concat:worker', 'uglify:worker']); + grunt.registerTask('client', ['concat:client', 'uglify:client']); + grunt.registerTask('default', ['worker', 'client']); +}; |
