diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..533ace1 --- /dev/null +++ b/.babelrc @@ -0,0 +1,9 @@ +{ + "presets": [ "es2015", "stage-3" ], + "plugins": [ + ["transform-runtime", { + "polyfill": false, + "regenerator": true + }] + ] +} \ No newline at end of file diff --git a/.npmignore b/.npmignore index 082d39e..6ca1d2e 100644 --- a/.npmignore +++ b/.npmignore @@ -1,9 +1,11 @@ +.babelrc .travis.yml .vscode src test dist/**/*.map dist/test +dist/lib tsconfig.json tslint.json *.tgz \ No newline at end of file diff --git a/package.json b/package.json index c7ea387..822a44d 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,9 @@ "url": "git+https://github.com/jdconley/argon2themax.git" }, "scripts": { - "prepublish": "rm -rf dist && tslint --project tslint.json && tsc -d && tsc -p .", - "pretest": "tslint --project tslint.json && tsc -p .", + "compile": "tslint --project tslint.json && tsc -d && tsc -p . && babel -d dist/lib/ dist/src/ && cp -rf dist/lib/* dist/src/", + "prepublish": "rm -rf dist && npm run compile", + "pretest": "npm run compile", "test": "mocha dist/test/*.js" }, "main": "dist/src/index.js", @@ -29,13 +30,14 @@ }, "license": "MIT", "engines": { - "node" : "^4.0.0" + "node": "^4.0.0" }, - "files":[ + "files": [ "dist/src" ], "dependencies": { "argon2": "^0.14.0", + "babel-runtime": "^6.11.6", "lodash": "^4.16.4" }, "devDependencies": { @@ -43,6 +45,10 @@ "@types/lodash": "^4.14.37", "@types/mocha": "^2.2.32", "@types/node": "^6.0.41", + "babel-cli": "^6.16.0", + "babel-plugin-transform-runtime": "^6.15.0", + "babel-preset-es2015": "^6.16.0", + "babel-preset-stage-3": "^6.17.0", "chai": "^3.5.0", "mocha": "^3.0.2", "tslint": "^3.15.1",