grunt-jsmin-sourcemap

Grunt task for JSMin and sourcemap

grunt-jsmin-sourcemap

Grunt task for JSMin and sourcemap

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-jsmin-sourcemap

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-jsmin-sourcemap');

grunt-jsmin-sourcemap is registered under the jsmin-sourcemap task. Your initConfig should look similar to this:

grunt.initConfig({
  'jsmin-sourcemap': {
    all: {
      // Source files to concatenate and minify (also accepts a string and minimatch items) 
      src: ['public/js/jquery.js', 'public/js/underscore.js'],
 
      // Destination for concatenated/minified JavaScript 
      dest: 'dist/js/all.min.js',
 
      // Destination for sourcemap of minified JavaScript 
      destMap: 'dist/js/all.js.map'
    }
  }
});

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint via grunt and test via npm test.

Copyright (c) 2012 Todd Wolfson Licensed under the MIT license.