Skip to content

Commit

Permalink
Merge pull request #308 from kadirahq/prepublish-in-js
Browse files Browse the repository at this point in the history
Wrote prepublish in javascript
  • Loading branch information
Muhammed Thanish authored Jul 13, 2016
2 parents a0bbf0b + 8e04589 commit 9fe0e95
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
17 changes: 17 additions & 0 deletions scripts/prepublish.js
Original file line number Diff line number Diff line change
@@ -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")

0 comments on commit 9fe0e95

Please sign in to comment.