Skip to content
This repository has been archived by the owner on Feb 25, 2019. It is now read-only.

Commit

Permalink
chore(npm): Babel-ize and Webpack-ify the lib
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrizagidulin committed Oct 11, 2016
1 parent 6bcc0f3 commit c3aa7d6
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
docs
node_modules
# Compiled lib directory
lib
# Bundles created by Webpack
dist
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
"test": "test"
},
"scripts": {
"babel": "babel src -d lib",
"build": "npm run clean && npm run babel",
"clean": "rm -rf dist/* && rm -rf lib/*",
"webpack": "webpack --progress --colors --optimize-minimize --optimize-occurrence-order --optimize-dedupe",
"dist": "npm run build && npm run webpack",
"postinstall": "npm run build",
"prepublish": "npm run build && npm run webpack",
"test": "mocha test -w",
"karma": "karma start",
"jsdoc": "jsdoc -c jsdoc.json -r"
Expand Down Expand Up @@ -34,13 +41,18 @@
},
"homepage": "https://github.com/anvilresearch/jose#README",
"dependencies": {
"babel-cli": "^6.16.0",
"babel-preset-es2015": "^6.16.0",
"base64url": "^1.0.6",
"json-document": "0.0.0",
"pem-jwk": "^1.5.1",
"qs": "^6.2.0",
"text-encoding": "^0.6.1"
"text-encoding": "^0.6.1",
"webcrypto": "^0.1.0"
},
"devDependencies": {
"babel-core": "^6.17.0",
"babel-loader": "^6.2.5",
"chai": "^3.5.0",
"karma": "^1.1.2",
"karma-chrome-launcher": "^1.0.1",
Expand Down
17 changes: 17 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var path = require('path')

module.exports = {
entry: [
'./lib/index.js'
],
output: {
path: path.join(__dirname, '/dist/'),
filename: 'jose.min.js',
library: 'JOSE',
libraryTarget: 'var'
},
externals: {
webcrypto: 'crypto'
},
devtool: 'source-map'
}

0 comments on commit c3aa7d6

Please sign in to comment.