I am trying to use Babel 6
to transplie ES2015 javascript
files. Two most simple cases, 1 file and files from a directory.
install babel-cli
and babel-preset-es2015
, create a .babelrc.
use command babel app.js --out-file appout.js.
complete, no problem.
then I try to transplie two files in a directory, one of them use export feature.
var shout = function(s){
return s.toUpperCase();
}
export shout;
then when I use cli to tranpile, babel src --out-dir lib it returns with an error,
unexpected token at export shout;
^
don't really understand what is wrong here.