Skip to content

Commit

Permalink
Wrote prepublish in javascript
Browse files Browse the repository at this point in the history
This allows storybook to be built in windows too.
  • Loading branch information
roonyh committed Jul 13, 2016
1 parent a0bbf0b commit 8e04589
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 8e04589

Please sign in to comment.