From fdad02561d3f2bd5025e69ec5184aa3a42c462ed Mon Sep 17 00:00:00 2001 From: lancegin Date: Wed, 28 Jun 2017 17:03:25 +0800 Subject: [PATCH] add: babel to build es6 to es5 --- .babelrc | 3 +++ .gitignore | 3 +++ package.json | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 .babelrc create mode 100644 package.json diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..6826043 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015", "stage-0"] +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 00cbbdf..ee8f95d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,9 @@ pids # Directory for instrumented libs generated by jscoverage/JSCover lib-cov +# Directort for babel-builded es2015 file +lib/ + # Coverage directory used by tools like istanbul coverage diff --git a/package.json b/package.json new file mode 100644 index 0000000..e78a2bb --- /dev/null +++ b/package.json @@ -0,0 +1,36 @@ +{ + "name": "jsotp", + "version": "1.0.0", + "description": "Javascript One-Time Password module.", + "main": "src/jsotp.js", + "directories": { + "doc": "docs", + "test": "tests" + }, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "babel src -d lib" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/LanceGin/jsotp.git" + }, + "keywords": [ + "otp", + "totp", + "hotp", + "rfc6238", + "rfc4226" + ], + "author": "lancegin", + "license": "MIT", + "bugs": { + "url": "https://github.com/LanceGin/jsotp/issues" + }, + "homepage": "https://github.com/LanceGin/jsotp#readme", + "devDependencies": { + "babel-cli": "^6.24.1", + "babel-preset-es2015": "^6.24.1", + "babel-preset-stage-0": "^6.24.1" + } +}