From 5cfe3d09fa2aea4ff965b35c671a33c153b76121 Mon Sep 17 00:00:00 2001 From: Jackson Tian Date: Sun, 16 Mar 2014 12:39:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7Loader=E7=89=88=E6=9C=AC?= =?UTF-8?q?=EF=BC=8C=E6=9B=B4=E9=80=82=E5=90=88=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 2 +- bin/combo | 27 --------------------------- package.json | 2 +- 3 files changed, 2 insertions(+), 29 deletions(-) delete mode 100755 bin/combo diff --git a/Makefile b/Makefile index ae0538b..c764127 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,7 @@ test-cov: cov @$(MAKE) -C .cov test REPORTER=html-cov > coverage.html build: - @./bin/combo views . + @./node_modules/loader/bin/build views . start: @nohup ./node_modules/.bin/forever `pwd`/app.js >> cnode.log 2>&1 & diff --git a/bin/combo b/bin/combo deleted file mode 100755 index e930e85..0000000 --- a/bin/combo +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env node -"use strict"; -var path = require('path'); -var fs = require('fs'); -var Loader = require('loader'); - -// app/views -var viewsDir = path.join(process.cwd(), process.argv[2]); -// app/ -var baseDir = path.join(process.cwd(), process.argv[3]); - -// scan views folder, get the assets map -var scaned = Loader.scanDir(viewsDir); -console.log("Scaned:"); -console.log(scaned); - -// need minify? -var justCombo = process.argv[4]; -// combo?md5 hash -var minified = Loader.minify(baseDir, scaned, justCombo); -console.log(minified); -console.log("Compile static assets done."); - -// write the assets mapping into assets.json -fs.writeFileSync(path.join(baseDir, 'assets.json'), JSON.stringify(Loader.map(minified))); -console.log("write assets.json done. assets.json: "); -console.log(fs.readFileSync(path.join(baseDir, 'assets.json'), 'utf-8')); diff --git a/package.json b/package.json index 8c3d712..f1c688f 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "utility": "0.0.x", "marked-prettyprint": "0.2.8", "xss": "~0.0.9", - "loader": "0.0.5", + "loader": "0.0.12", "passport": "~0.1.17", "passport-github": "~0.1.5", "forever": "~0.10.11"