Skip to content

Commit

Permalink
Merge pull request #205 from chriskrycho/parent-options-204
Browse files Browse the repository at this point in the history
Use *either* addon or app options, never both.
  • Loading branch information
simonexmachina authored Jan 31, 2019
2 parents 3c2ca0b + e88874e commit 84e4947
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,14 @@ module.exports = {

sassOptions: function () {
var env = process.env.EMBER_ENV;
var options = (this.app && this.app.options && this.app.options.sassOptions) || {};
var parentOption = (this.parent && this.parent.app && this.parent.app.options && this.parent.app.options.sassOptions) || {};
var envConfig = this.project.config(env).sassOptions;

Object.assign(options, parentOption);
// *Either* use the options for an addon which is consuming this, *or* for
// an app which is consuming this, but never *both* at the same time. The
// special case here is when testing an addon.
var options = (this.app && this.app.options && this.app.options.sassOptions)
|| (this.parent && this.parent.options && this.parent.options.sassOptions)
|| {};

if (envConfig) {
console.warn("Deprecation warning: sassOptions should be moved to your ember-cli-build"); // eslint-disable-line
Expand Down

0 comments on commit 84e4947

Please sign in to comment.