ember-cli-htmlbars
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -8,2 +8,3 @@ 'use strict'; | ||
var stringify = require('json-stable-stringify'); | ||
var stripBom = require('strip-bom'); | ||
@@ -68,3 +69,3 @@ function TemplateCompiler (inputTree, _options) { | ||
TemplateCompiler.prototype.processString = function (string, relativePath) { | ||
return 'export default ' + utils.template(this.options.templateCompiler, string, { | ||
return 'export default ' + utils.template(this.options.templateCompiler, stripBom(string), { | ||
moduleName: relativePath | ||
@@ -71,0 +72,0 @@ }) + ';'; |
{ | ||
"name": "ember-cli-htmlbars", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A library for adding htmlbars to ember CLI", | ||
@@ -38,4 +38,5 @@ "main": "index.js", | ||
"ember-cli-version-checker": "^1.0.2", | ||
"json-stable-stringify": "^1.0.0" | ||
"json-stable-stringify": "^1.0.0", | ||
"strip-bom": "^2.0.0" | ||
} | ||
} |
@@ -42,2 +42,15 @@ 'use strict'; | ||
it('ignores utf-8 byte order marks', function(){ | ||
var tree = templateCompilerFilter(sourcePath, htmlbarsOptions); | ||
builder = new broccoli.Builder(tree); | ||
return builder.build().then(function(results) { | ||
var actual = fs.readFileSync(results.directory + '/template-with-bom.js', { encoding: 'utf8'}); | ||
var source = fs.readFileSync(sourcePath + '/template.hbs', { encoding: 'utf8' }); | ||
var expected = 'export default Ember.HTMLBars.template(' + htmlbarsPrecompile(source, { moduleName: 'template-with-bom.hbs' }) + ');'; | ||
assert.equal(actual,expected,'They dont match!'); | ||
}); | ||
}); | ||
it('passes FEATURES to compiler when provided as `FEATURES` [DEPRECATED]', function(){ | ||
@@ -44,0 +57,0 @@ htmlbarsOptions.FEATURES = { |
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
15409
18
295
4
+ Addedstrip-bom@^2.0.0
+ Addedis-utf8@0.2.1(transitive)
+ Addedstrip-bom@2.0.0(transitive)