Skip to content
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
17 changes: 13 additions & 4 deletions ember-addon-main.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
name: 'ember-cli-htmlbars',

init: function() {
this._super.init && this._super.init.apply(this, arguments);
if (this._super.init) { this._super.init.apply(this, arguments); }
checker.assertAbove(this, '0.1.2');
},

Expand Down Expand Up @@ -60,17 +60,26 @@ module.exports = {
var config = this.projectConfig();
var templateCompilerPath = config['ember-cli-htmlbars'] && config['ember-cli-htmlbars'].templateCompilerPath;

if (!templateCompilerPath) {
var ember = this.project.findAddonByName('ember-core');
if (ember) {
return ember.absolutePaths.templateCompiler;
} else if (!templateCompilerPath) {
templateCompilerPath = this.project.bowerDirectory + '/ember/ember-template-compiler';
}

return path.resolve(this.project.root, templateCompilerPath);
var absolutePath = path.resolve(this.project.root, templateCompilerPath);

if (path.extname(absolutePath) === '') {
absolutePath += '.js';
Copy link
Member

Choose a reason for hiding this comment

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

this is required to properly clear the cache below (because the path is stored with its extension in the cache)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm this.templateCompilerPath() now returns (sometimes with '.js')

I can add a ensureEndsInJs() or something

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@stefanpenner stefanpenner May 22, 2016

Choose a reason for hiding this comment

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

ah, we already had this conversation :P #68 (comment)

}

return absolutePath;
},

htmlbarsOptions: function() {
var projectConfig = this.projectConfig() || {};
var EmberENV = projectConfig.EmberENV || {};
var templateCompilerPath = this.templateCompilerPath() + '.js';
var templateCompilerPath = this.templateCompilerPath();

global.EmberENV = EmberENV; // Needed for eval time feature flag checks
var htmlbarsOptions = {
Expand Down