diff options
Diffstat (limited to 'Gruntfile.js')
| -rw-r--r-- | Gruntfile.js | 91 |
1 files changed, 76 insertions, 15 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 371228c..42d25c3 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,31 +3,89 @@ module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), + dentist: { + options: { + include_js: "app.min.js", + include_css: "app.css" + }, + build: { + src: 'shader-combo.html', + dest_js: 'dist/app.init.js', + dest_css: 'dist/app.css', + dest_html: 'dist/index.html' + } + }, concat: { - dist: { + options: { + separator: ";" + }, + build: { src: [ - 'js/vendor/jquery/jquery.js', - 'js/vendor/loader.js', - 'js/mx/mx.js', - 'js/mx/mx.*.js', - 'js/spinner.js', - 'js/pano.js' - + "js/vendor/acorn.js", + "js/vendor/gif.js", + "js/vendor/gif-encode.min.js", + "js/vendor/jquery/jquery.min.js", + "js/vendor/jquery-ui-1.10.3.custom.min.js", + "js/vendor/canvasquery.js", + "js/vendor/FileSaver/FileSaver.js", + "js/vendor/dataUriToBlob.js", + "js/util.js", + "js/color.js", + "js/asdf.js", + "js/image.js", + "js/user.js", + "js/gallery.js", + "js/frames.js", + "js/render.js", + "js/shader.js", + "js/error.highlight.js", + "js/help.js", + "js/api/gallery.js", + "js/api/get.js", + "js/api/set.js", + "shaders.json", + "dist/app.init.js", ], - dest: 'js/live.concat.js', + dest: 'dist/app.concat.js', } }, uglify: { options: { - banner: '/* asdf.us/dither */\n' + banner: '/* asdf.us/shader */\n' }, build: { - src: 'js/live.concat.js', - dest: 'js/live.min.js' + src: 'dist/app.concat.js', + dest: 'dist/app.min.js' } }, + clean: { + release: ["dist/app.concat.js","dist/app.init.js"], + }, + copy: { + build: { + files: [ + { + nonull: true, + expand: true, + src: ['commands.html', 'tutorial.html', 'img/*'], + dest: "dist/", + }, + ] + }, + release: { + files: [ + { + nonull: true, + expand: true, + cwd: 'dist/', + src: ['**'], + dest: process.env.HOME + '/asdf/shader/', + }, + ] + }, + }, watch: { - files: ['js/!(live.min|live.concat).js','js/vendor/*'], + files: ['dist/!(app.min|app.concat).js'], tasks: ['default'] } }); @@ -36,8 +94,11 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-contrib-watch'); - + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-dentist'); // Default task(s). - grunt.registerTask('default', ['concat', 'uglify']); + grunt.registerTask('default', ['dentist:build', 'concat:build', 'uglify:build', 'copy:build']); + grunt.registerTask('install', ['default', 'clean', 'copy:release']); }; |
