In many of my applications I use the NPM package.json
to manage my build tools. I've found that one of the modules probably has a bug. I'd like to debug it but I don't know how to debug the application in the context of the build task.
Specifically, in this case, I'm using Ember-cli. Ember-cli has a build command: ember build
that builds the app using a bunch of modules defined in package.json
such as ember-cli-compass-compiler
.
I want to be able to add breakpoints or some sort of logging at certain points of the ember-cli-compass-compiler
module that are triggered when the build runs so that I can inspect values.
Looks like according to https://github.com/ember-cli/ember-cli/blob/c8934ab0f2eb3aab03ce4557a36c317887245b95/lib/models/project.js as part of the build step is to look at the project's package.json and check for ember-cli-compass. After which, it would presumably use your project's local version of ember-cli-compass-compiler to execute some tasks. The simplest way to debug it is to use console.log() and log various points inside ember-cli-compass-compiler to see what code paths are being triggered.
The codebase for the compiler is very small, and you'd probably want to start with the index.js https://github.com/quaertym/ember-cli-compass-compiler/blob/master/index.js