Commit 13e887d9 by kzc Committed by Marijn Haverbeke

fix CLI --output file name for --input file with .jsx suffix (#151)

parent debd3b98
Pipeline #5379637 passed with stage
in 2 minutes 40 seconds
......@@ -36,7 +36,10 @@ function compileFile ( from, to, command, options ) {
if ( ext !== '.js' && ext !== '.jsm' && ext !== '.es6' && ext !== '.jsx') return;
if ( to ) to = to.slice( 0, -ext.length ) + '.js';
if ( to ) {
var extTo = path.extname( to );
to = to.slice( 0, -extTo.length ) + '.js';
}
var source = fs.readFileSync( from, 'utf-8' );
var result = buble.transform( source, {
......
buble input.js -o actual/output.js
buble input.jsx -o actual/output.js
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment