Skip to content

Commit

Permalink
Enable browser use
Browse files Browse the repository at this point in the history
  • Loading branch information
nfroidure committed Jun 26, 2015
1 parent 7302ca2 commit d09b974
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 13 deletions.
6 changes: 6 additions & 0 deletions jssrc/post.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// This file need to be append to the build in order to work with browserify
// Shamelessly stolen here: https://github.com/fabiosantoscode/require-emscripten/blob/master/post-js.postjs
module.exports = Module;

// Do not recurse into module and waste all day
Module.inspect = function() { return '[Module]' }
10 changes: 5 additions & 5 deletions jssrc/ttf2woff2.js

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.1.1",
"description": "Convert TTF files to WOFF2 ones.",
"main": "src/index.js",
"browser": "jssrc/index.js",
"directories": {
"test": "tests"
},
Expand All @@ -13,8 +14,8 @@
"cli": "env NPM_RUN_CLI=1",
"configure": "node-gyp configure",
"make": "node-gyp build",
"emcc": "miniquery -p \"targets.#.sources.#\" ./binding.gyp | grep -v \"csrc/addon.cc\" | xargs emcc -o jssrc/ttf2woff2.js -O3 --memory-init-file 0 -s EXPORTED_FUNCTIONS=\"['_convertTTFToWOFF2','_freeTTFToWOFF2']\" -s \"TOTAL_MEMORY=536870912\" -s \"ALLOW_MEMORY_GROWTH=1\" csrc/fallback.cc",
"emcc-debug": "miniquery -p \"targets.#.sources.#\" ./binding.gyp | grep -v \"csrc/addon.cc\" | xargs emcc -o jssrc/ttf2woff2.js -s EXPORTED_FUNCTIONS=\"['_convertTTFToWOFF2','_freeTTFToWOFF2']\" -s \"ALLOW_MEMORY_GROWTH=1\" -s \"ASSERTIONS=1\" csrc/fallback.cc",
"emcc": "miniquery -p \"targets.#.sources.#\" ./binding.gyp | grep -v \"csrc/addon.cc\" | xargs emcc -o jssrc/ttf2woff2.js -O3 --memory-init-file 0 -s EXPORTED_FUNCTIONS=\"['_convertTTFToWOFF2','_freeTTFToWOFF2']\" -s \"TOTAL_MEMORY=536870912\" -s \"ALLOW_MEMORY_GROWTH=1\" --post-js jssrc/post.js csrc/fallback.cc",
"emcc-debug": "miniquery -p \"targets.#.sources.#\" ./binding.gyp | grep -v \"csrc/addon.cc\" | xargs emcc -o jssrc/ttf2woff2.js -s EXPORTED_FUNCTIONS=\"['_convertTTFToWOFF2','_freeTTFToWOFF2']\" -s \"ALLOW_MEMORY_GROWTH=1\" -s \"ASSERTIONS=1\" --post-js jssrc/post.js csrc/fallback.cc",
"install": "(node-gyp rebuild > builderror.log) || (exit 0)"
},
"repository": {
Expand All @@ -34,16 +35,16 @@
"homepage": "https://github.com/nfroidure/ttf2woff2",
"dependencies": {
"bufferstreams": "^1.0.2",
"bindings": "~1.2.1",
"nan": "~1.8.4",
"bindings": "^1.2.1",
"nan": "^1.8.4",
"node-gyp": "^2.0.1"
},
"devDependencies": {
"coveralls": "~2.11.2",
"istanbul": "~0.3.16",
"coveralls": "^2.11.2",
"istanbul": "^0.3.16",
"miniquery": "^1.1.1",
"mocha": "~2.2.5",
"mocha-lcov-reporter": "0.0.2"
"mocha": "^2.2.5",
"mocha-lcov-reporter": "^0.0.2"
},
"preferGlobal": "true",
"bin": {
Expand Down

0 comments on commit d09b974

Please sign in to comment.