this.node = new NodeJsExecutor();
this.node.setModule(getClass(), "browserify-" + this.version,
"browserify.js");
} catch (final IOException e) {
this.node = null;
throw new SmallerException("Failed to setup node for browserify", e);
}
}
final String outfile = this.node.run(vfs,
resource != null ? resource.getPath() : null, options);
if (outfile != null) {
final VFile file = vfs.find('/' + outfile);
if (!file.exists()) {
throw new SmallerException("BrowserifyProcessor result does not exists");
}
}
return resource == null || outfile == null ? resource : resource
.getResolver().resolve('/' + outfile);
}