From 69e31d220d9d37aa8ce8c5725fc177d4b5111521 Mon Sep 17 00:00:00 2001 From: chee rabbits Date: Sat, 17 Aug 2013 19:24:48 +0100 Subject: [PATCH] now we are talking, it can be shrunked --- Gruntfile.js | 59 +++++--------------------------------------------- app/.htaccess | 10 ++++----- app/index.html | 6 +++++ package.json | 3 ++- 4 files changed, 18 insertions(+), 60 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 2ea552c..26b4180 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -25,14 +25,6 @@ module.exports = function (grunt) { grunt.initConfig({ yeoman: yeomanConfig, watch: { - coffee: { - files: ['<%= yeoman.app %>/scripts/{,*/}*.coffee'], - tasks: ['coffee:dist'] - }, - coffeeTest: { - files: ['test/spec/{,*/}*.coffee'], - tasks: ['coffee:test'] - }, compass: { files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'], tasks: ['compass:server', 'autoprefixer'] @@ -70,16 +62,6 @@ module.exports = function (grunt) { } } }, - test: { - options: { - middleware: function (connect) { - return [ - mountFolder(connect, '.tmp'), - mountFolder(connect, 'test') - ]; - } - } - }, dist: { options: { middleware: function (connect) { @@ -108,34 +90,6 @@ module.exports = function (grunt) { }, server: '.tmp' }, - mocha: { - all: { - options: { - run: true, - urls: ['http://localhost:<%= connect.options.port %>/index.html'] - } - } - }, - coffee: { - dist: { - files: [{ - expand: true, - cwd: '<%= yeoman.app %>/scripts', - src: '{,*/}*.coffee', - dest: '.tmp/scripts', - ext: '.js' - }] - }, - test: { - files: [{ - expand: true, - cwd: 'test/spec', - src: '{,*/}*.coffee', - dest: '.tmp/spec', - ext: '.js' - }] - } - }, compass: { options: { sassDir: '<%= yeoman.app %>/styles', @@ -184,13 +138,14 @@ module.exports = function (grunt) { // Options: https://github.com/jrburke/r.js/blob/master/build/example.build.js options: { // `name` and `out` is set by grunt-usemin - baseUrl: yeomanConfig.app + '/scripts', + baseUrl: yeomanConfig.app, optimize: 'none', // TODO: Figure out how to make sourcemaps work with grunt-usemin // https://github.com/yeoman/grunt-usemin/issues/30 //generateSourceMaps: true, // required to support SourceMaps // http://requirejs.org/docs/errors.html#sourcemapcomments + name: "scripts/main", preserveLicenseComments: false, useStrict: true, wrap: true @@ -262,7 +217,7 @@ module.exports = function (grunt) { htmlmin: { dist: { options: { - /*removeCommentsFromCDATA: true, + removeCommentsFromCDATA: true, // https://github.com/yeoman/grunt-usemin/issues/44 //collapseWhitespace: true, collapseBooleanAttributes: true, @@ -270,7 +225,7 @@ module.exports = function (grunt) { removeRedundantAttributes: true, useShortDoctype: true, removeEmptyAttributes: true, - removeOptionalTags: true*/ + removeOptionalTags: true }, files: [{ expand: true, @@ -307,15 +262,12 @@ module.exports = function (grunt) { concurrent: { server: [ 'compass', - 'coffee:dist', 'copy:styles' ], test: [ - 'coffee', 'copy:styles' ], dist: [ - 'coffee', 'compass', 'copy:styles', 'imagemin', @@ -352,8 +304,6 @@ module.exports = function (grunt) { 'clean:server', 'concurrent:test', 'autoprefixer', - 'connect:test', - 'mocha' ]); grunt.registerTask('build', [ @@ -362,6 +312,7 @@ module.exports = function (grunt) { 'concurrent:dist', 'autoprefixer', 'requirejs', + 'concat', 'cssmin', 'uglify', diff --git a/app/.htaccess b/app/.htaccess index cb84cb9..a477577 100644 --- a/app/.htaccess +++ b/app/.htaccess @@ -499,11 +499,11 @@ FileETag None # To understand why this is important and a better idea than `*.css?v231`, read: # http://stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring -# -# RewriteCond %{REQUEST_FILENAME} !-f -# RewriteCond %{REQUEST_FILENAME} !-d -# RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L] -# + + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L] + # ------------------------------------------------------------------------------ # | File concatenation | diff --git a/app/index.html b/app/index.html index daa28c2..bb07804 100644 --- a/app/index.html +++ b/app/index.html @@ -6,10 +6,16 @@ Recently + + + + + +