From 53dded79b735112865e32fe0bdcd3e881ab9fe9b Mon Sep 17 00:00:00 2001 From: Juanfran Date: Tue, 12 Aug 2014 09:49:25 +0200 Subject: [PATCH] improve jade performance --- app/partials/views/components/mainTitle.jade | 2 +- gulpfile.coffee | 18 +++++++++----- package.json | 25 ++++++++++---------- 3 files changed, 25 insertions(+), 20 deletions(-) diff --git a/app/partials/views/components/mainTitle.jade b/app/partials/views/components/mainTitle.jade index 2e55f6ba..e96f923b 100644 --- a/app/partials/views/components/mainTitle.jade +++ b/app/partials/views/components/mainTitle.jade @@ -1,4 +1,4 @@ header h1 span(tg-bo-bind="project.name") - span.green(tg-bo-bind="sectionName") + span.green(tg-bo-bind="sectionName") \ No newline at end of file diff --git a/gulpfile.coffee b/gulpfile.coffee index 5a7eec88..c7b0cd18 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -20,6 +20,7 @@ connect = require("gulp-connect") scsslint = require("gulp-scss-lint") newer = require("gulp-newer") cache = require("gulp-cached") +jadeInheritance = require('gulp-jade-inheritance') paths = { app: "app" @@ -76,17 +77,22 @@ paths = { ] } - -# Ordered list of vendor/external libraries. - - -############################################################################## +############################################################################ # Layout/CSS Related tasks ############################################################################## gulp.task "jade", -> gulp.src(paths.jade) .pipe(plumber()) + .pipe(cache("jade")) + .pipe(jade({pretty: true})) + .pipe(gulp.dest("#{paths.dist}/partials")) + +gulp.task "jade_watch", -> + gulp.src(paths.jade) + .pipe(plumber()) + .pipe(cache("jade")) + .pipe(jadeInheritance({basedir: './app/'})) .pipe(jade({pretty: true})) .pipe(gulp.dest("#{paths.dist}/partials")) @@ -211,7 +217,7 @@ gulp.task "express", -> # Rerun the task when a file changes gulp.task "watch", -> - gulp.watch(paths.jade, ["jade"]) + gulp.watch(paths.jade, ["jade_watch"]) gulp.watch(paths.scssStyles, ["scsslint", "styles", "csslint-app"]) gulp.watch(paths.css, ["styles", "csslint-vendor"]) gulp.watch(paths.coffee, ["coffee"]) diff --git a/package.json b/package.json index 6cd9ccd1..af097028 100644 --- a/package.json +++ b/package.json @@ -17,37 +17,36 @@ } ], "devDependencies": { - "gulp": "^3.8.0", "coffee-script": "^1.7.1", "express": "^4.3.0", - "gulp-clean": "^0.2.4", - "gulp-coffee": "~1.4.1", - "gulp-coffeelint": "^0.2.2", - "gulp-concat": "^2.1.7", - "gulp-if": "0.0.5", - "gulp-plumber": "^0.5.6", - "gulp-rename": "^1.2.0", - "gulp-template": "^0.1.1", - "gulp-uglify": "~0.2.0", - "gulp-util": "~2.2.14", - "gulp-wrap": "^0.3.0", + "gulp": "^3.8.0", "gulp-cached": "0.0.3", "gulp-changed": "^0.4.0", "gulp-clean": "^0.2.4", + "gulp-coffee": "~1.4.1", + "gulp-coffeelint": "^0.2.2", "gulp-compass": "^1.1.9", + "gulp-concat": "^2.1.7", "gulp-connect": "^2.0.5", "gulp-csslint": "^0.1.3", "gulp-filesize": "0.0.6", + "gulp-if": "0.0.5", "gulp-imagemin": "^0.5.0", "gulp-jade": "^0.5.0", + "gulp-jade-inheritance": "0.0.2", "gulp-minify-css": "^0.3.1", "gulp-minify-html": "^0.1.3", "gulp-newer": "^0.3.0", "gulp-notify": "^1.2.5", "gulp-plumber": "^0.6.2", + "gulp-rename": "^1.2.0", "gulp-ruby-sass": "^0.4.3", "gulp-scss-lint": "0.1.0", "gulp-styledocco": "0.0.1", - "gulp-watch": "^0.5.4" + "gulp-template": "^0.1.1", + "gulp-uglify": "~0.2.0", + "gulp-util": "~2.2.14", + "gulp-watch": "^0.5.4", + "gulp-wrap": "^0.3.0" } }