Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not require parent addon to include ember-cli-htmlbars #73

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions ember-addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ module.exports = {
addPlugin(includer, pluginPath);
}

this.templateCompilerPath = this.parent.addons
.find((a) => a.name === 'ember-cli-htmlbars')
.templateCompilerPath();
// Used in ember-cli-htmlbars to get the location of templateCompiler without traversing this.addons (https://github.com/ember-cli/ember-cli-htmlbars/blob/6860beed9a357d5e948abd09754e8a978fed1320/lib/ember-addon-main.js#L264)
let ember = this.project.findAddonByName('ember-source');

this.templateCompilerPath = ember.absolutePaths.templateCompiler;
Comment on lines +26 to +29
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick note here: this is public API from Ember's perspective for determining the path to the template compiler. Basically:

const emberAddon = require('ember-source');
const templateCompiler = require(emberAddon.absolutePaths.templateCompiler);

},

setupPreprocessorRegistry(type, registry) {
Expand Down