Created
December 18, 2012 09:07
-
-
Save sapphiriq/4326419 to your computer and use it in GitHub Desktop.
Revisions
-
sapphiriq revised this gist
Dec 18, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -140,7 +140,7 @@ module.exports = (grunt) -> grunt.registerTask 'default', ['copy:build', 'jade', 'coffee', 'less:build'] grunt.registerTask 'build', 'default' grunt.registerTask 'release', ['build', 'copy:release', 'less:release', 'concat', 'uglify'] connect = require 'connect' -
sapphiriq revised this gist
Dec 18, 2012 . 3 changed files with 69 additions and 34 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,24 +7,27 @@ module.exports = (grunt) -> meta: version: '0.1.0', banner: '/*!\n * Sapphiriq - v<%= meta.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + ' * http://sapphiriq.ru/\n' + ' * Copyright (c) <%= grunt.template.today("yyyy") %>\n */\n' clean: build: ['build'] release: ['release'] copy: build: files: 'build/img/': 'src/img/**' 'build/js/': 'src/vendor/js/**' # 'build/css/': 'src/vendor/css/**' release: files: 'release/': 'build/**' jade: build: options: pretty: true files: grunt.file.expandMapping(["src/jade/*.jade"], "build", @@ -34,65 +37,93 @@ module.exports = (grunt) -> coffee: build: files: grunt.file.expandMapping(["src/coffee/**/*.coffee"], "build/js/", rename: (destBase, destPath) -> destBase + destPath.replace(/src\/coffee/, '').replace(/\.coffee$/, ".js") ) less: build: options: compress: false files: "build/css/style.css": "src/less/style.less" release: options: compress: true files: "release/css/style.css": "src/less/style.less" # lint: { # files: ['grunt.js', 'src/**/*.js', 'test/**/*.js'] # }, # qunit: { # files: ['test/**/*.html'] # }, watch: coffee: files: ['src/coffee/**/*.coffee'] tasks: ['coffee:build'] less: files: ['src/less/**/*.less'] tasks: 'less:build' jade: files: ['src/jade/**/*.jade'] tasks: 'jade:build' js: files: ['src/vendor/js/**/*.js'] tasks: 'copy:build' css: files: ['src/vendor/css/**/*.css'] tasks: 'copy:build' img: files: ['src/img/**/*'] tasks: 'copy:build' # jshint: { # options: { # curly: true, # eqeqeq: true, # immed: true, # latedef: true, # newcap: true, # noarg: true, # sub: true, # undef: true, # boss: true, # eqnull: true, # browser: true # }, # globals: { # jQuery: true # } # }, concat: dist: options: banner: '<%= meta.banner %>' src: 'release/js/app.js' dest: 'release/js/app.js' uglify: app: options: banner: '<%= meta.banner %>' files: 'release/js/app.js': ['<%= concat.dist.dest %>'] grunt.loadNpmTasks 'grunt-contrib-jade' @@ -103,15 +134,17 @@ module.exports = (grunt) -> grunt.loadNpmTasks 'grunt-contrib-concat' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-copy' grunt.loadNpmTasks 'grunt-contrib-clean' # Default task. grunt.registerTask 'default', ['copy:build', 'jade', 'coffee', 'less:build'] grunt.registerTask 'build', 'default' grunt.registerTask 'release', ['copy:build', 'jade', 'coffee', 'copy:release', 'less:release', 'concat', 'uglify'] connect = require 'connect' grunt.registerTask "server", "Start a custom static web server.", -> grunt.log.writeln "Starting static web server in \"build\" on port 8080." connect(connect.static("build")).listen 8080 grunt.task.run('default') This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ |-- build |-- src | |-- coffee | |-- img | |-- jade | |-- less | `-- vendor This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,8 @@ { "name": "Sapphiriq", "version": "0.0.0", "description": "# Sapphiriq", "main": "Gruntfile.coffee", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, @@ -20,6 +20,7 @@ "grunt-contrib-watch": "~0.2.0", "grunt-contrib-concat": "~0.1.1", "grunt-contrib-copy": "~0.3.2", "grunt-contrib-clean": "~0.4.0a", "connect": "~2.7.1" } } -
sapphiriq revised this gist
Dec 18, 2012 . 1 changed file with 8 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,10 @@ module.exports = (grunt) -> '* Copyright (c) <%= grunt.template.today("yyyy") %> */\n' copy: img: files: 'build/img/': 'src/img/**' js: files: 'build/js/': 'src/vendor/js/**' # css: @@ -79,6 +82,10 @@ module.exports = (grunt) -> css: files: ['src/vendor/css/**/*.css'] tasks: 'copy' img: files: ['src/img/**/*'] tasks: 'copy:img' uglify: app: -
sapphiriq created this gist
Dec 18, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,111 @@ #global module:false module.exports = (grunt) -> # Project configuration. grunt.initConfig meta: version: '0.1.0', banner: '/*! Sapphiriq - v<%= meta.version %> - ' + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + '* http://sapphiriq.ru/\n' + '* Copyright (c) <%= grunt.template.today("yyyy") %> */\n' copy: js: files: 'build/js/': 'src/vendor/js/**' # css: # files: # 'build/css/': 'src/vendor/css/**' jade: development: options: pretty: true files: grunt.file.expandMapping(["src/jade/*.jade"], "build", rename: (destBase, destPath) -> destBase + destPath.replace(/src\/jade/, '').replace(/\.jade$/, ".html") ) coffee: compile: files: grunt.file.expandMapping(["src/coffee/**/*.coffee"], "build/js/", rename: (destBase, destPath) -> destBase + destPath.replace(/src\/coffee/, '').replace(/\.coffee$/, ".js") ) less: development: options: compress: false files: "build/css/style.css": "src/less/style.less" production: options: compress: true files: "build/css/style.css": "src/less/style.less" concat: dist: options: banner: '<%= meta.banner %>' src: 'build/js/app.js' dest: 'build/js/app.js' watch: coffee: files: ['src/coffee/**/*.coffee'] tasks: ['coffee', 'concat', 'uglify'] less: files: ['src/less/**/*.less'] tasks: 'less:development' jade: files: ['src/jade/**/*.jade'] tasks: 'jade:development' js: files: ['src/vendor/js/**/*.js'] tasks: 'copy' css: files: ['src/vendor/css/**/*.css'] tasks: 'copy' uglify: app: options: banner: '<%= meta.banner %>' files: 'build/js/app.min.js': ['<%= concat.dist.dest %>'] grunt.loadNpmTasks 'grunt-contrib-jade' grunt.loadNpmTasks 'grunt-contrib-less' grunt.loadNpmTasks 'grunt-contrib-coffee' grunt.loadNpmTasks 'grunt-contrib-watch' grunt.loadNpmTasks 'grunt-contrib-concat' grunt.loadNpmTasks 'grunt-contrib-uglify' grunt.loadNpmTasks 'grunt-contrib-copy' # Default task. grunt.registerTask 'default', ['copy', 'jade', 'less:development', 'coffee'] grunt.registerTask 'production', ['copy', 'jade', 'less:production', 'coffee', 'concat', 'uglify'] connect = require 'connect' grunt.registerTask "server", "Start a static web server with file watcher.", -> grunt.log.writeln "Starting static web server in \"build\" on port 8080." connect(connect.static("build")).listen 8080 grunt.task.run('default') grunt.task.run('watch') This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ # Structure project_root |-- build |-- src | |-- coffee | |-- jade | |-- less | `-- vendor | |-- css | `-- js |-- Gruntfile.js `-- package.json This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ { "name": "Sapphiriq", "version": "0.0.0", "description": "# Sapphiriq.ru", "main": "grunt.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "repository": "", "author": "", "license": "BSD", "devDependencies": { "grunt": "~0.4.0", "grunt-contrib-jshint": "~0.1.0", "grunt-contrib-nodeunit": "~0.1.0", "grunt-contrib-less": "~0.3.2", "grunt-contrib-coffee": "~0.3.2", "grunt-contrib-jade": "~0.3.1", "grunt-contrib-uglify": "~0.1.0", "grunt-contrib-watch": "~0.2.0", "grunt-contrib-concat": "~0.1.1", "grunt-contrib-copy": "~0.3.2", "connect": "~2.7.1" } }