haul
haul copied to clipboard
Node API
To use the Node API, you need to create a compiler:
// Spawn a worker with the specified options.
const compiler = Haul.create({
platform: 'android',
context: process.cwd(),
production: false,
minify: false,
bundle: false,
port: 3021,
config: require('./haul.config.js'),
});
// Trigger a build
compiler.build()
.map(result => match (result.type) {
'success': `Bundle built in ${result.duration}`,
'error': `Failed to build bundle`,
else: null,
})
.filter(Boolean)
.subscribe(console.log);
// Symbolicate
compiler.symbolicate(frames)
.subscribe(result => console.log(result.stack));
// Kill the server and cleanup
compiler.destroy();
This issue assumes that #287 is done.
What were you thinking the watch api would look like?
@zamotany Now that #287 (#339) is done. Is something like this possible? There doesn't seem to be the necessary exports in order to achieve the above
@aaronschubert0 It's possible to start implementing this API because we've rebuilt the internals as part #287. This is just a proposal, yet accepted and we want to have this feature.