Skip to content

Commit

Permalink
Add addon options templateCompilerPath (adopted-ember-addons#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
shamcode committed Sep 7, 2018
1 parent eb092ce commit 422d309
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ module.exports = {
var lsReloader = require('./lib/hot-reloader')(config.options, this.supportedTypes);
lsReloader.run();
},
_getTemplateCompilerPath() {
var npmCompilerPath = path.join('ember-source', 'dist', 'ember-template-compiler.js');
return path.relative(this.project.root, require.resolve(npmCompilerPath));
},
included: function (app) {
this._super.included(app);

Expand All @@ -24,9 +28,7 @@ module.exports = {
var config = app.project.config('development');
var addonConfig = config[this.name] || { supportedTypes: ['components'] };
this.supportedTypes = addonConfig['supportedTypes'] || ['components'];

var npmCompilerPath = path.join('ember-source', 'dist', 'ember-template-compiler.js');
var npmPath = path.relative(app.project.root, require.resolve(npmCompilerPath));
var npmPath = addonConfig['templateCompilerPath'] || this._getTemplateCompilerPath();

// Require template compiler as in CLI this is only used in build, we need it at runtime
if (fs.existsSync(npmPath)) {
Expand Down

0 comments on commit 422d309

Please sign in to comment.