X-Git-Url: http://jaekl.net/gitweb/?p=quanweb.git;a=blobdiff_plain;f=js%2FGruntfile.js;h=f6fee4d5ee1375b330d4f53cfccf66295bcd7050;hp=c6ebaa933d7f787c77f73ab189d1a86aea7ee7c8;hb=13efcb823cde095d5562ac061ef5a859d91c0f70;hpb=222a53b5def154dcc59dbaad98404ea2930e8434 diff --git a/js/Gruntfile.js b/js/Gruntfile.js index c6ebaa9..f6fee4d 100644 --- a/js/Gruntfile.js +++ b/js/Gruntfile.js @@ -1,25 +1,38 @@ module.exports = function(grunt) { - // Project configuration. - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - uglify: { - options: { - banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n', - mangle: false - }, - app: { - files: { - '../app/lib.min.js': ['BooksModel.js', 'BooksView.js', 'PagingController.js', 'SearchController.js', 'ToolTip.js', 'Main.js'] - } - } - } - }); + // Project configuration. + grunt.initConfig({ + concat: { + all: { + src: ['src/**/*.js', 'Main.js'], + dest: '../app/all.js', + nonull: true + }, + tests: { + src: ['src/**/*.js', 'test/**/*.js'], + dest: 'all_tests.js', + nonull: true + }, + }, + + pkg: grunt.file.readJSON('package.json'), - // Load the plugin that provides the "uglify" task. - grunt.loadNpmTasks('grunt-contrib-uglify'); + uglify: { + options: { + banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n', + mangle: false + }, + app: { + files: { + '../app/lib.min.js': ['src/**/*.js', 'Main.js'] + } + } + } + }); - // Default task(s). - grunt.registerTask('default', ['uglify']); + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + // Default task(s). + grunt.registerTask('default', ['concat', 'uglify']); };