Skip to content

Commit

Permalink
WIP: add shouldIncludeStyleguide option (embermap#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrowlingson committed Apr 19, 2018
1 parent 2430f27 commit 804e7d5
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,19 @@ module.exports = {
this._super.included.apply(this, arguments);

let buildTarget = includer.options &&
includer.options['ember-cli-tailwind'] &&
includer.options['ember-cli-tailwind']['buildTarget'];
includer.options[this.name] &&
includer.options[this.name]['buildTarget'];

if (!this._validateBuildTarget(buildTarget, includer)) {
return;
}

let buildConfig = buildDestinations[buildTarget];

this.import('vendor/etw.css');


if (this._shouldIncludeStyleguide()) {
this.import('vendor/etw.css');
}

this.projectType = buildConfig.type;
this.tailwindInputPath = this._getInputPath(this.parent.root, buildConfig.path);
},
Expand All @@ -56,6 +58,12 @@ module.exports = {
}
},

_shouldIncludeStyleguide() {
let envConfig = this.project.config(this.app.env)[this.name];
let shouldOverrideDefault = envConfig !== undefined && envConfig.shouldIncludeStyleguide !== undefined;
return shouldOverrideDefault ? envConfig.shouldIncludeStyleguide : this.app.env !== 'production';
},

// Private

_getInputPath(root, inputPath) {
Expand Down

0 comments on commit 804e7d5

Please sign in to comment.