Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
Only pass moduleName if available and is not unknown
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmit committed May 11, 2016
1 parent c0a65ea commit c2ea0c5
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
@@ -4,10 +4,13 @@ module.exports = function(precompile) {

var replaceNodeWithPrecompiledTemplate = function(node, template, file) {
var moduleName = file.opts && file.opts.filenameRelative;
var opts = {};

var compiledTemplateString = "Ember.HTMLBars.template(" + precompile(template, {
moduleName: moduleName
}) + ")";
if (moduleName && moduleName !== 'unknown') {
opts.moduleName = moduleName;
}

var compiledTemplateString = "Ember.HTMLBars.template(" + precompile(template, opts) + ")";

// Prefer calling replaceWithSourceString if it is present.
// this prevents a deprecation warning in Babel 5.6.7+.

0 comments on commit c2ea0c5

Please sign in to comment.