denali-js / cli

The official CLI for starting, building, and running Denali apps and addons
MIT License
5 stars 5 forks source link

Builder should have some way to specify compile-time options to addons #27

Open ghost opened 7 years ago

ghost commented 7 years ago

There are some addons (e.g. denali-mailer) that do some custom build behavior of the app they are installed to. Currently (unless I skimmed too quickly), there is not a way to do that. The denali-build.js returns an extension of Builder, so it shouldn't be too difficult to standardize a way of adding configuration that addons can then check.

Note: I'm drawing this idea from Ember's ability to pass in configuration to addons via the ember-cli-build.js file.

davewasmer commented 7 years ago

Customization of the consuming app's tree should be possible via processParent() on the builder. Or am I misunderstanding?

acburdine commented 7 years ago

I'm saying apps should have some standardized way to pass configure options to an addon that's building the app via processParent.

Say there's some config value an app can set for denali-babel. denali-babel looks to see if config value exists in the parent (app/addon), then potentially changes how it runs depending on that config value.