Debugging Broccoli.js 1.0


#1

Firstly I apologize that this is not the right place for this. I’m unsure where to go in Slack to get help :slight_smile:.

I’m using Broccoli.js 1.0 for my build pipeline separately from Ember for basic JS stuff. The Broccoli Stew addon is great but doesn’t work with 1.0 yet. I’ve tried using Broccoli Debug but I get no results out of it so I’m unsure if it’s also not supporting 1.0 atm or if something else is amiss.

So my question is how do I go about debugging a basic build pipeline using Broccoli.js version 1.0? I’d be happy to move this topic to a more appropriate place if someone could point me in the right direction :slight_smile:

Cheers!


#2

broccoli-debug is tested against Broccoli 1.0, and should work properly. How are you using it?


#3

I thought it should :slight_smile:

Command I’m executing: BROCCOLI_DEBUG=rams-debug:* yarn build

const Funnel = require('broccoli-funnel');
const Debug = require('broccoli-debug');

let debugTree = Debug.buildDebugCallback('rams-debug')

let allJs = new Funnel('static_src/js');
debugTree(allJs, 'js-files');
...

The build runs without issue but there’s no created DEBUG directory. When I print the resulting node from the call to debugTree I see it’s configured to output DEBUG in the right spot.


#4

The way both broccoli-stew and broccoli-debug work is that they return a new wrapped tree, which you must use in the rest of your pipeline. The way you have it there debugTree is creating a new tree which is never used.

A small refactor for example purposes, would be:

let debugTree = Debug.buildDebugCallback('rams-debug')

let allJs = new Funnel('static_src/js');
allJs = debugTree(allJs, 'js-files');

I personally prefer to name each variable a different thing, but hopefully it illustrates the issue?


#5

:man_facepalming: I’m still getting used to how Broccoli operates… Thank you! You’re a gentleman and a scholar.