Skip to content

Commit

Permalink
feat: add browser support
Browse files Browse the repository at this point in the history
  • Loading branch information
vhpoet committed Oct 31, 2016
1 parent ba96980 commit 86e0c5b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["es2015"],
"plugins": ["babel-plugin-add-module-exports"]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ docs/build/
/docs/README.intermediate.md
.tags*
/jsdoc-out/
/dist/
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "3.2.0",
"description": "Implementation of Interledger condition validation and fulfillment",
"main": "index.js",
"browser": "./dist/index.js",
"directories": {
"test": "test"
},
Expand All @@ -12,6 +13,8 @@
"tweetnacl": "^0.14.1"
},
"devDependencies": {
"babel-loader": "^6.2.7",
"babel-plugin-add-module-exports": "^0.2.1",
"babel-plugin-transform-runtime": "^6.7.5",
"babel-preset-es2015": "^6.9.0",
"babel-runtime": "^6.9.0",
Expand All @@ -28,6 +31,7 @@
"interledger-jsdoc-template": "^2.0.0",
"istanbul-harmony": "^0.3.16",
"jsdoc": "^3.4.0",
"json-loader": "^0.5.4",
"karma": "^1.1.0",
"karma-browserify": "^5.0.5",
"karma-mocha": "^1.1.0",
Expand All @@ -38,10 +42,12 @@
"readme-to-test": "justmoon/readme-to-test#feature/st-improvements",
"sinon": "^1.17.4",
"validate-commit-msg": "^2.1.0",
"watchify": "^3.7.0"
"watchify": "^3.7.0",
"webpack": "^1.13.3"
},
"scripts": {
"lint": "eslint .",
"prepublish": "webpack --config webpack.config.js",
"test:readme": "readme-to-test",
"test:specs": "NODE_ENV=unit node node_modules/.bin/istanbul test -- _mocha",
"test:phantom": "karma start --single-run",
Expand Down
26 changes: 26 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const webpack = require('webpack')
const UglifyJsPlugin = webpack.optimize.UglifyJsPlugin;

module.exports = {
entry: './index.js',
output: {
path: __dirname + '/dist',
filename: 'index.js',
library: 'FiveBellsCondition',
libraryTarget: 'umd',
umdNamedDefine: true
},
progress: true,
module: {
loaders: [
{ test: /\.js$/, exclude: /node_modules/, loader: 'babel'},
{ test: /\.json$/, loader: 'json-loader' }
]
},
node: {
fs: "empty"
},
plugins: [
new UglifyJsPlugin()
]
}

0 comments on commit 86e0c5b

Please sign in to comment.