amend-bundle
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -94,6 +94,11 @@ require('node-jsx').install({extension: '.jsx'}) | ||
function doBabel(code) { | ||
var transformed = babel.transform(code, { blacklist: [ 'strict' ]}).code | ||
var exportIndex = R.indexOf('module.exports', transformed) | ||
return R.drop(exportIndex, transformed) | ||
function doBabel(mod) { | ||
try { | ||
var transformed = babel.transform(mod.code, { blacklist: [ 'strict' ]}).code | ||
var exportIndex = R.indexOf('module.exports', transformed) | ||
var trimmed = R.drop(exportIndex, transformed) | ||
return R.assoc('code', trimmed, mod) | ||
} catch (e) { | ||
throw new Error('Babel error in module ' + mod.path) | ||
} | ||
} | ||
@@ -125,3 +130,3 @@ | ||
R.map(removeLastSemi, codeLens), | ||
R.map(doBabel, codeLens) | ||
doBabel | ||
) | ||
@@ -128,0 +133,0 @@ |
{ | ||
"name": "amend-bundle", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Bundle all code from an amend container to one file", | ||
@@ -5,0 +5,0 @@ "main": "./lib/bundle.js", |
10602
299