module.exports = function(grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        concat: {
            options: {
                separator: '\n'
            },
            dist: {
                src: [
                    'vendor/**/*.js',
                    'template/_header.js',
                    'src/**/*.js',
                    'template/_footer.js',
                    'plugins/**/*.js'
                ],
                dest: 'build/<%= pkg.name %>.js'
            }
        },
        uglify: {
            options: {
                banner: '/*! Raven.js <%= pkg.version %> | github.com/getsentry/raven-js */\n'
            },
            dist: {
                files: {
                    'build/<%= pkg.name %>.min.js': ['<%= concat.dist.dest %>']
                }
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-concat');

    grunt.registerTask('default', ['concat', 'uglify']);

};

@@ -32,30 +32,120 @@
 ) %7B%0A
-%0A    grunt.ini
+    var _ = grunt.util._;%0A%0A    var plugins = (grunt.option('plugins') %7C%7C '').split(',');%0A%0A    var grun
 tConfig
-(
+ = 
 %7B%0A  
@@ -484,47 +484,8 @@
 .js'
-,%0A                    'plugins/**/*.js'
 %0A   
@@ -897,16 +897,484 @@
  %7D%0A    %7D
+;%0A%0A    // Create plugin paths and verify hey exist%0A    var plugins = _.map(plugins, function (plugin) %7B%0A        var path = 'plugins/' + plugin + '.js';%0A%0A        if(!grunt.file.exists(path))%0A            throw new Error(%22Plugin '%22 + plugin + %22' not found in plugins directory.%22);%0A%0A        return path;%0A    %7D);%0A%0A    // Amend plugins to the concat source list%0A    gruntConfig.concat.dist.src = gruntConfig.concat.dist.src.concat(plugins);%0A%0A    grunt.initConfig(gruntConfig
 );%0A%0A    

Add optional plugin build options