diff --git a/package.json b/package.json index 2f0616e6b92..7d732227613 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "mocha": "--require scripts/mocha_runner src/**/__tests__/**/*.js" }, "scripts": { - "prepublish": "./scripts/prepublish.sh", + "prepublish": "node scripts/prepublish.js", "lint": "eslint src", "lintfix": "eslint src --fix", "testonly": "mocha $npm_package_options_mocha", diff --git a/scripts/prepublish.js b/scripts/prepublish.js new file mode 100755 index 00000000000..1fd3cef498e --- /dev/null +++ b/scripts/prepublish.js @@ -0,0 +1,17 @@ +require('shelljs/global') +var path = require('path') + +console.log("> Start transpiling ES2015") + +rm('-rf', 'dist') + +var babel = ['node_modules', '.bin', 'babel'].join(path.sep); +exec(babel + " --ignore __tests__,manager --plugins transform-runtime src --out-dir dist") + +if(process.env.DEV_BUILD){ + var webpack = ['node_modules', '.bin', 'webpack'].join(path.sep); + var webpackManagerConf = ["scripts", "webpack.manager.conf.js"].join(path.sep); + exec(webpack + " --config " + webpackManagerConf) +} + +console.log("> Complete transpiling ES2015")