ember-template-imports
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -0,1 +1,10 @@ | ||
## v1.1.1 (2021-03-25) | ||
#### :bug: Bug Fix | ||
* [#16](https://github.com/ember-template-imports/ember-template-imports/pull/16) Make getting the template compiler path lazy ([@pzuraq](https://github.com/pzuraq)) | ||
#### Committers: 1 | ||
- Chris Garrett ([@pzuraq](https://github.com/pzuraq)) | ||
## v1.1.0 (2021-03-25) | ||
@@ -2,0 +11,0 @@ |
13
index.js
@@ -45,2 +45,6 @@ 'use strict'; | ||
}; | ||
this.templateCompilerPath = this.parent.addons | ||
.find((a) => a.name === 'ember-cli-htmlbars') | ||
.templateCompilerPath(); | ||
}, | ||
@@ -58,10 +62,9 @@ | ||
if (type === 'parent') { | ||
let templateCompilerPath = this.parent.addons | ||
.find((a) => a.name === 'ember-cli-htmlbars') | ||
.templateCompilerPath(); | ||
let TemplateImportPreprocessor = require('./lib/preprocessor-plugin'); | ||
registry.add('js', new TemplateImportPreprocessor(templateCompilerPath)); | ||
registry.add( | ||
'js', | ||
new TemplateImportPreprocessor(() => this.templateCompilerPath) | ||
); | ||
} | ||
}, | ||
}; |
@@ -8,3 +8,3 @@ const stew = require('broccoli-stew'); | ||
constructor( | ||
templateCompilerPath, | ||
getTemplateCompilerPath, | ||
importIdentifier = 'hbs', | ||
@@ -16,5 +16,5 @@ importPath = 'ember-template-imports', | ||
this.name = 'template-imports-preprocessor'; | ||
this.getTemplateCompilerPath = getTemplateCompilerPath; | ||
this.templateTagConfig = { | ||
getTemplateLocalsRequirePath: templateCompilerPath, | ||
getTemplateLocalsExportPath: '_GlimmerSyntax.getTemplateLocals', | ||
@@ -30,3 +30,2 @@ | ||
this.templateLiteralConfig = { | ||
getTemplateLocalsRequirePath: templateCompilerPath, | ||
getTemplateLocalsExportPath: '_GlimmerSyntax.getTemplateLocals', | ||
@@ -47,13 +46,14 @@ | ||
(string, relativePath) => { | ||
let config = { | ||
relativePath, | ||
getTemplateLocalsRequirePath: this.getTemplateCompilerPath(), | ||
}; | ||
if (relativePath.match(/\.(gjs|gts)$/)) { | ||
return preprocessEmbeddedTemplates( | ||
string, | ||
Object.assign({ relativePath }, this.templateTagConfig) | ||
).output; | ||
Object.assign(config, this.templateTagConfig); | ||
} else { | ||
return preprocessEmbeddedTemplates( | ||
string, | ||
Object.assign({ relativePath }, this.templateLiteralConfig) | ||
).output; | ||
Object.assign(config, this.templateLiteralConfig); | ||
} | ||
return preprocessEmbeddedTemplates(string, config).output; | ||
} | ||
@@ -60,0 +60,0 @@ ); |
{ | ||
"name": "ember-template-imports", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "The default blueprint for ember-cli addons.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
20537
115