module.exports = function(grunt) {

  var cssMin = {
      src: 'dist/<%= pkg.name %>.css',
      dest: 'dist/<%= pkg.name %>.min.css'
    };

  // Project configuration.
  grunt.initConfig({
    pkg: '<json:package.json>',
    meta: {
        banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
                '<%= grunt.template.today("yyyy-mm-dd") %> */'
    },
    build: {main: {}, amd: {}, css: {}},
    concat: {
      amd: {
        src: ['templates/amd_top.js', 'js/*.js', 'templates/amd_bottom.js'],
        dest: 'dist/<%= pkg.name %>.amd.js'
      },
      main: {
        src: ['js/*.js'],
        dest: 'dist/<%= pkg.name %>.js'
      },
      css: {
        src: ['css/jslider.css', 'css/*.css'],
        dest: 'dist/<%= pkg.name %>.css'
      }
    },
    min: {
      amd: {
        src: ['<banner:meta.banner>', '<config:concat.amd.dest>'],
        dest: 'dist/<%= pkg.name %>.amd.min.js'
      },
      main: {
        src: ['<banner:meta.banner>', '<config:concat.main.dest>'],
        dest: 'dist/<%= pkg.name %>.min.js'
      }
    },
    'min-css': {
      main: cssMin,
      amd: cssMin
    },
    uglify: {}
  });

  // Default task.
  grunt.registerTask('default', function() {
      grunt.task.run(['build:main', 'build:amd']);
    });
  grunt.registerMultiTask('min-css', 'Minify CSS', function() {
    var compressor = require('yuicompressor');
    compressor.compress(this.data.src, {
      //Compressor Options:
      charset: 'utf8',
      type: 'css',
      'line-break': 80,
      outfile: this.data.dest
    }, function(err, data, extra) {
      //err   If compressor encounters an error, it's stderr will be here
      //data  The compressed string, you write it out where you want it
      //extra The stderr (warnings are printed here in case you want to echo them
      print(extra);
      throw err;
    });
  });
  grunt.registerMultiTask('build', '',
     function() {
        var parts = ['concat', 'min', 'min-css'], i;
        for (i=0; i<parts.length; i+=1) {
            parts[i] = parts[i] + ':' + this.target;
        }
        grunt.task.run(parts);
     });

};

@@ -133,18 +133,235 @@
 s'%0A    %7D
+,%0A    jsOrder = %5B%0A      'js/jshashtable-2.1_src.js',%0A      'js/tmpl.js',%0A      'js/jquery.dependClass-0.1.js',%0A      'js/jquery.numberformatter-1.2.3.js',%0A      'js/draggable-0.2.js',%0A      'js/jquery.slider.js'%0A    %5D
 ;%0A
-
 %0A  // Pr
@@ -689,21 +689,34 @@
 .js'
-, 'js/*.js', 
+%5D.concat(jsOrder).concat(%5B
 'tem
@@ -733,24 +733,25 @@
 _bottom.js'%5D
+)
 ,%0A        de
@@ -824,19 +824,15 @@
 rc: 
-%5B'js/*.js'%5D
+jsOrder
 ,%0A  

Fix concatenation order of JS files.