module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    jade: {
      debug: {
        options: {
          data: {
            debug: true
          },
          pretty: true
        },
        files: {
          "debug/popup.html": "modules/jade/popup.jade"
        }
      },
      release: {
        options: {
          data: {
            debug: false
          },
          pretty: false
        },
        files: {
          "chrome-plugin/popup.html": ["modules/jade/popup.jade"],
        },
        compile: {
          expand: true
        }
      }
    },
    cssmin: {
      main: {
        src: 'chrome-plugin/assets/css/plugin.css',
        dest: 'chrome-plugin/assets/css/plugin.min.css'
      }
    },
    uglify: {
      js: {
        options: {
          preserveComments: true
        },
        files: {
          'chrome-plugin/assets/js/popup.min.js': 'modules/js/popup.js'
        }
      }
    },
    watch: {
      scripts: {
        files: ['**/*.js'],
        tasks: ['concat:js', 'uglify:js'],
        options: {
          spawn: false,
        },
      },
      jade: {
        files: ['**/*.jade'],
        tasks: ['jade:debug', 'jade:release'],
        options: {
          spawn: false,
        },
      },
      css: {
        files: ['**/*.css'],
        tasks: ['cssmin:main',],
        options: {
          spawn: false,
        },
      },
    },
  });

  // Load the plugin that provides the "uglify" task.
  grunt.loadNpmTasks('grunt-contrib-jade');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-contrib-watch');
  //grunt.task.requires()
  grunt.registerTask('default', ['jade:debug', 'jade:release', 'uglify:js', 'cssmin:main', 'watch']);
};

/*
# Only concat CSS files
grunt concat:css 

# Concat CSS and JS files, but don't do anything else
grunt concat
*/
@@ -906,38 +906,429 @@
 ': '
-modules/js/popup.js'%0A        %7D
+chrome-plugin/assets/js/popup.js'%0A        %7D%0A      %7D%0A    %7D,%0A    concat: %7B%0A      options: %7B%0A        separator: ';',%0A      %7D,%0A      js: %7B%0A        src: %5B'modules/js/bundle.js'%5D,%0A        dest: 'chrome-plugin/assets/js/popup.js'%0A      %7D%0A    %7D,%0A    browserify: %7B%0A      extension: %7B%0A        options: %7B%0A          exclude: %5B'lapack'%5D%0A        %7D,%0A        src: %5B'index.js', 'modules/js/popup.js'%5D,%0A        dest: 'modules/js/bundle.js'
 %0A   
@@ -1413,16 +1413,40 @@
 tasks: %5B
+'browserify:extension', 
 'concat:
@@ -2068,16 +2068,105 @@
 atch');%0A
+  grunt.loadNpmTasks('grunt-contrib-concat');%0A  grunt.loadNpmTasks('grunt-browserify');%0A%0A
   //grun
@@ -2245,16 +2245,53 @@
 elease',
+ 'browserify:extension', 'concat:js',
  'uglify

add browserify grunt task