ember-cli-htmlbars
Advanced tools
Comparing version 4.3.1 to 4.4.0
@@ -0,1 +1,9 @@ | ||
## v4.4.0 (2020-08-11) | ||
#### :rocket: Enhancement | ||
* [#598](https://github.com/ember-cli/ember-cli-htmlbars/pull/598) Pass `isProduction` to Ember template compiler. ([@rwjblue](https://github.com/rwjblue)) | ||
#### Committers: 1 | ||
- Robert Jackson ([@rwjblue](https://github.com/rwjblue)) | ||
## v4.3.1 (2020-04-09) | ||
@@ -2,0 +10,0 @@ |
@@ -63,2 +63,4 @@ 'use strict'; | ||
let isProduction = process.env.EMBER_ENV === 'production'; | ||
// when this.parent === this.project, `this.parent.name` is a function 😭 | ||
@@ -77,3 +79,3 @@ let parentName = typeof this.parent.name === 'function' ? this.parent.name() : this.parent.name; | ||
let shouldColocateTemplates = this._addon._shouldColocateTemplates(); | ||
let htmlbarsOptions = this._addon.htmlbarsOptions(); | ||
let htmlbarsOptions = Object.assign({ isProduction }, this._addon.htmlbarsOptions()); | ||
@@ -92,6 +94,11 @@ let inputTree = debugTree(tree, '01-input'); | ||
precompile(string, options) { | ||
precompile(string, _options) { | ||
let options = _options; | ||
let htmlbarsOptions = this._addon.htmlbarsOptions(); | ||
let templateCompiler = htmlbarsOptions.templateCompiler; | ||
if (isProduction) { | ||
options = Object.assign({ isProduction }, _options); | ||
} | ||
return utils.template(templateCompiler, string, options); | ||
@@ -151,2 +158,4 @@ }, | ||
let isProduction = process.env.EMBER_ENV === 'production'; | ||
// add the babel-plugin-htmlbars-inline-precompile to the list of plugins | ||
@@ -163,3 +172,4 @@ // used by `ember-cli-babel` addon | ||
pluginInfo, | ||
templateCompilerPath | ||
templateCompilerPath, | ||
isProduction | ||
); | ||
@@ -173,2 +183,3 @@ | ||
let htmlBarsPlugin = utils.setup(pluginInfo, { | ||
isProduction, | ||
projectConfig: this.projectConfig(), | ||
@@ -175,0 +186,0 @@ templateCompilerPath, |
@@ -74,2 +74,3 @@ 'use strict'; | ||
contents: string, | ||
isProduction: this.options.isProduction, | ||
moduleName: relativePath, | ||
@@ -76,0 +77,0 @@ parseOptions: { |
@@ -49,3 +49,3 @@ 'use strict'; | ||
function buildParalleizedBabelPlugin(pluginInfo, templateCompilerPath) { | ||
function buildParalleizedBabelPlugin(pluginInfo, templateCompilerPath, isProduction) { | ||
let parallelBabelInfo = { | ||
@@ -56,2 +56,3 @@ requireFile: require.resolve('./require-from-worker'), | ||
templateCompilerPath, | ||
isProduction, | ||
parallelConfigs: pluginInfo.parallelConfigs, | ||
@@ -181,2 +182,3 @@ modules: INLINE_PRECOMPILE_MODULES, | ||
let precompiled = templateCompiler.precompile(string, options); | ||
return 'Ember.HTMLBars.template(' + precompiled + ')'; | ||
@@ -204,3 +206,3 @@ } | ||
require.resolve('babel-plugin-htmlbars-inline-precompile'), | ||
{ precompile, modules: INLINE_PRECOMPILE_MODULES }, | ||
{ precompile, isProduction: options.isProduction, modules: INLINE_PRECOMPILE_MODULES }, | ||
'ember-cli-htmlbars:inline-precompile', | ||
@@ -207,0 +209,0 @@ ]; |
{ | ||
"name": "ember-cli-htmlbars", | ||
"version": "4.3.1", | ||
"version": "4.4.0", | ||
"description": "A library for adding htmlbars to ember CLI", | ||
@@ -36,3 +36,3 @@ "keywords": [ | ||
"@ember/edition-utils": "^1.2.0", | ||
"babel-plugin-htmlbars-inline-precompile": "^3.0.1", | ||
"babel-plugin-htmlbars-inline-precompile": "^3.2.0", | ||
"broccoli-debug": "^0.6.5", | ||
@@ -39,0 +39,0 @@ "broccoli-persistent-filter": "^2.3.1", |
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
54916
950
10