# HG changeset patch # User ymh # Date 1400236551 -7200 # Node ID 8cafab7c4b18917956787669633e345ee520c4ce # Parent 8a6eb26ac87fd452642f32a822dba5b603f965c1 change gruntfile case step 1 diff -r 8a6eb26ac87f -r 8cafab7c4b18 client/Gruntfile.js --- a/client/Gruntfile.js Fri May 16 09:23:11 2014 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ - -module.exports = function(grunt) { - - 'use strict'; - - var renkan_src = [ - 'js/main.js', - 'js/models.js', - 'js/defaults.js', - 'js/i18n.js', - 'js/full-json.js', - 'js/ldtjson-bin.js', - 'js/list-bin.js', - 'js/wikipedia-bin.js', - 'dist/js/paper-renderer.js' - ]; - - var renkan_banner = grunt.file.read('js/header.js').toString() + - '\n/*! <%= pkg.name %> - v<%= pkg.version %> - Copyright © IRI ' + - '<%= grunt.template.today("yyyy") %> */\n\n'; - - // Project configuration. - grunt.initConfig({ - pkg: grunt.file.readJSON('package.json'), - requirejs: { - renderer: { - options: { - baseUrl: "js/", - name: "build-renderer", - out: "dist/js/paper-renderer.js", - optimize: "none", - beautify: true, - paths: { - requtils: "require-utils", - jquery: "empty:", - underscore: "empty:" - } - } - } - }, - uglify: { - options: { - banner: renkan_banner, - sourceMap: true, - sourceMapIncludeSources: true - }, - renkan: { - files : { - 'dist/js/renkan.min.js' : renkan_src - } - } - }, - concat: { - options: { - banner: renkan_banner - }, - renkan: { - files : { - 'dist/js/renkan.js' : renkan_src - } - } - }, - clean: { - options: { - force: true - }, - renderer: ["dist/js/paper-renderer.js"], - renkan: ["dist/"], - }, - cssmin: { - options: { - banner: renkan_banner - }, - renkan: { - expand: true, - cwd: 'css/', - src: ['*.css'], - dest: 'dist/css', - ext: '.min.css' - } - }, - copy: { - renkan: { - files: [ - {expand: true, cwd: '', src: ['img/*'], dest: 'dist/', filter: 'isFile'}, - {expand: true, cwd: '', src: ['data/properties.json'], dest: 'dist/', filter: 'isFile'}, - {expand: true, cwd: '', src: ['lib/**'], dest: 'dist/'} - ] - }, - renkan_css: { - options: { - process: function (content, srcpath) { - return grunt.template.process(renkan_banner) + content; - } - }, - files: [{expand: true, cwd: '', src: ['css/*'], dest: 'dist/', filter: 'isFile'}] - } - }, - jshint: { - options: { - reporter: require('jshint-stylish') - }, - all: ['Gruntfile.js', 'js/**/*.js'] - }, - connect: { - server: { - options: { - port: 9001, - base: '.', - keepalive: true, - useAvailablePort: true, - debug: true - } - } - } - }); - - // Load the plugin that provides the "uglify" task. - grunt.loadNpmTasks('grunt-contrib-requirejs'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-cssmin'); - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-contrib-connect'); - - // Default task(s). - grunt.registerTask('default', ['requirejs', 'concat', 'uglify', 'cssmin', 'copy', 'clean:renderer']); - - -}; diff -r 8a6eb26ac87f -r 8cafab7c4b18 client/Gruntfile.js.tmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/Gruntfile.js.tmp Fri May 16 12:35:51 2014 +0200 @@ -0,0 +1,129 @@ + +module.exports = function(grunt) { + + 'use strict'; + + var renkan_src = [ + 'js/main.js', + 'js/models.js', + 'js/defaults.js', + 'js/i18n.js', + 'js/full-json.js', + 'js/ldtjson-bin.js', + 'js/list-bin.js', + 'js/wikipedia-bin.js', + 'dist/js/paper-renderer.js' + ]; + + var renkan_banner = grunt.file.read('js/header.js').toString() + + '\n/*! <%= pkg.name %> - v<%= pkg.version %> - Copyright © IRI ' + + '<%= grunt.template.today("yyyy") %> */\n\n'; + + // Project configuration. + grunt.initConfig({ + pkg: grunt.file.readJSON('package.json'), + requirejs: { + renderer: { + options: { + baseUrl: "js/", + name: "build-renderer", + out: "dist/js/paper-renderer.js", + optimize: "none", + beautify: true, + paths: { + requtils: "require-utils", + jquery: "empty:", + underscore: "empty:" + } + } + } + }, + uglify: { + options: { + banner: renkan_banner, + sourceMap: true, + sourceMapIncludeSources: true + }, + renkan: { + files : { + 'dist/js/renkan.min.js' : renkan_src + } + } + }, + concat: { + options: { + banner: renkan_banner + }, + renkan: { + files : { + 'dist/js/renkan.js' : renkan_src + } + } + }, + clean: { + options: { + force: true + }, + renderer: ["dist/js/paper-renderer.js"], + renkan: ["dist/"], + }, + cssmin: { + options: { + banner: renkan_banner + }, + renkan: { + expand: true, + cwd: 'css/', + src: ['*.css'], + dest: 'dist/css', + ext: '.min.css' + } + }, + copy: { + renkan: { + files: [ + {expand: true, cwd: '', src: ['img/*'], dest: 'dist/', filter: 'isFile'}, + {expand: true, cwd: '', src: ['data/properties.json'], dest: 'dist/', filter: 'isFile'}, + {expand: true, cwd: '', src: ['lib/**'], dest: 'dist/'} + ] + }, + renkan_css: { + options: { + process: function (content, srcpath) { + return grunt.template.process(renkan_banner) + content; + } + }, + files: [{expand: true, cwd: '', src: ['css/*'], dest: 'dist/', filter: 'isFile'}] + } + }, + jshint: { + all: ['Gruntfile.js', 'js/**/*.js'] + }, + connect: { + server: { + options: { + port: 9001, + base: '.', + keepalive: true, + useAvailablePort: true, + debug: true + } + } + } + }); + + // Load the plugin that provides the "uglify" task. + grunt.loadNpmTasks('grunt-contrib-requirejs'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-clean'); + grunt.loadNpmTasks('grunt-contrib-cssmin'); + grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-jshint'); + grunt.loadNpmTasks('grunt-contrib-connect'); + + // Default task(s). + grunt.registerTask('default', ['requirejs', 'concat', 'uglify', 'cssmin', 'copy', 'clean:renderer']); + + +};