ember-cli-htmlbars
Advanced tools
Comparing version 1.3.4 to 1.3.5
@@ -22,2 +22,25 @@ 'use strict'; | ||
purgeModule: function(templateCompilerPath) { | ||
// ensure we get a fresh templateCompilerModuleInstance per ember-addon | ||
// instance NOTE: this is a quick hack, and will only work as long as | ||
// templateCompilerPath is a single file bundle | ||
// | ||
// (╯°□°)╯︵ ɹǝqɯǝ | ||
// | ||
// we will also fix this in ember for future releases | ||
// Module will be cached in .parent.children as well. So deleting from require.cache alone is not sufficient. | ||
var mod = require.cache[templateCompilerPath]; | ||
if (mod && mod.parent) { | ||
var index = mod.parent.children.indexOf(mod); | ||
if (index >= 0) { | ||
mod.parent.children.splice(index, 1); | ||
} else { | ||
throw new TypeError("ember-cli-htmlbars attempted to purge '" + templateCompilerPath + "' but something went wrong."); | ||
} | ||
} | ||
delete require.cache[templateCompilerPath]; | ||
}, | ||
setupPreprocessorRegistry: function(type, registry) { | ||
@@ -85,10 +108,3 @@ // ensure that broccoli-ember-hbs-template-compiler is not processing hbs files | ||
// ensure we get a fresh templateCompilerModuleInstance per ember-addon | ||
// instance NOTE: this is a quick hack, and will only work as long as | ||
// templateCompilerPath is a single file bundle | ||
// | ||
// (╯°□°)╯︵ ɹǝqɯǝ | ||
// | ||
// we will also fix this in ember for future releases | ||
delete require.cache[templateCompilerPath]; | ||
this.purgeModule(templateCompilerPath); | ||
@@ -112,3 +128,4 @@ var clonedEmberENV = JSON.parse(JSON.stringify(EmberENV)); | ||
delete require.cache[templateCompilerPath]; | ||
this.purgeModule(templateCompilerPath); | ||
delete global.Ember; | ||
@@ -115,0 +132,0 @@ delete global.EmberENV; |
{ | ||
"name": "ember-cli-htmlbars", | ||
"version": "1.3.4", | ||
"version": "1.3.5", | ||
"description": "A library for adding htmlbars to ember CLI", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13155
243