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: { options: { separator: ";" }, build: { src: [ "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/save.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: 'dist/app.concat.js', } }, uglify: { options: { banner: '/* asdf.us/shader */\n' }, build: { 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: ['dist/!(app.min|app.concat).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'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-dentist'); // Default task(s). grunt.registerTask('default', ['dentist:build', 'concat:build', 'uglify:build', 'copy:build']); grunt.registerTask('install', ['default', 'clean', 'copy:release']); };