From a95a351c62d7227100adc19a96edc2138908a58e Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 11 Apr 2013 23:30:24 +0100 Subject: Add browser support using browserify --- .gitignore | 2 ++ index.html | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/browser.js | 3 +++ makefile | 12 ++++++++- 4 files changed, 93 insertions(+), 1 deletion(-) create mode 100644 index.html create mode 100644 lib/browser.js diff --git a/.gitignore b/.gitignore index 928aae9..df8e9e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /node_modules /_build /static/bootstrap +/static/jszip +/bundle.js diff --git a/index.html b/index.html new file mode 100644 index 0000000..b3bc2e0 --- /dev/null +++ b/index.html @@ -0,0 +1,77 @@ + + + + Mammoth + + + + + +
+ +
+ + + + + + + + + + diff --git a/lib/browser.js b/lib/browser.js new file mode 100644 index 0000000..6d06c4a --- /dev/null +++ b/lib/browser.js @@ -0,0 +1,3 @@ +exports.q = require("q"); +exports.mammoth = require("./"); +exports.Buffer = Buffer; diff --git a/makefile b/makefile index c95ce77..aa71fe0 100644 --- a/makefile +++ b/makefile @@ -3,9 +3,19 @@ test: node_modules/.bin/mocha tests -setup: +setup: static/bootstrap static/jszip + +static/bootstrap: mkdir -p _build/bootstrap curl -L https://github.com/twitter/bootstrap/archive/v2.3.1.tar.gz | tar xz --directory _build/bootstrap --strip-components 1 cd _build/bootstrap; npm install; make bootstrap cp -rT _build/bootstrap/bootstrap static/bootstrap + +static/jszip: + mkdir -p _build/jszip + curl -L https://github.com/Stuk/jszip/archive/v1.0.1.tar.gz | tar xz --directory _build/jszip --strip-components 1 + mkdir -p static/jszip + cp _build/jszip/*.js static/jszip +bundle.js: + node_modules/.bin/browserify lib/browser.js --standalone MAMMOTH > bundle.js -- cgit v1.2.3