ember-cli-htmlbars
Advanced tools
Comparing version 6.1.1 to 6.2.0
@@ -199,41 +199,39 @@ 'use strict'; | ||
let { templateCompiler } = htmlbarsOptions; | ||
if (options.requiresModuleApiPolyfill) { | ||
let templatePrecompile = templateCompiler.precompile; | ||
let templatePrecompile = templateCompiler.precompile; | ||
let precompile = (template, _options) => { | ||
// we have to reverse these for reasons that are a bit bonkers. the initial | ||
// version of this system used `registeredPlugin` from | ||
// `ember-template-compiler.js` to set up these plugins (because Ember ~ 1.13 | ||
// only had `registerPlugin`, and there was no way to pass plugins directly | ||
// to the call to `compile`/`precompile`). calling `registerPlugin` | ||
// unfortunately **inverted** the order of plugins (it essentially did | ||
// `PLUGINS = [plugin, ...PLUGINS]`). | ||
// | ||
// sooooooo...... we are forced to maintain that **absolutely bonkers** ordering | ||
let astPlugins = [...pluginInfo.plugins].reverse(); | ||
let precompile = (template, _options) => { | ||
// we have to reverse these for reasons that are a bit bonkers. the initial | ||
// version of this system used `registeredPlugin` from | ||
// `ember-template-compiler.js` to set up these plugins (because Ember ~ 1.13 | ||
// only had `registerPlugin`, and there was no way to pass plugins directly | ||
// to the call to `compile`/`precompile`). calling `registerPlugin` | ||
// unfortunately **inverted** the order of plugins (it essentially did | ||
// `PLUGINS = [plugin, ...PLUGINS]`). | ||
// | ||
// sooooooo...... we are forced to maintain that **absolutely bonkers** ordering | ||
let astPlugins = [...pluginInfo.plugins].reverse(); | ||
let options = { | ||
plugins: { | ||
ast: astPlugins, | ||
}, | ||
let options = { | ||
plugins: { | ||
ast: astPlugins, | ||
}, | ||
..._options, | ||
}; | ||
..._options, | ||
return templatePrecompile(template, options); | ||
}; | ||
return templatePrecompile(template, options); | ||
}; | ||
precompile.baseDir = () => path.resolve(__dirname, '..'); | ||
precompile.baseDir = () => path.resolve(__dirname, '..'); | ||
let cacheKey; | ||
precompile.cacheKey = () => { | ||
if (cacheKey === undefined) { | ||
cacheKey = makeCacheKey(templateCompilerPath, pluginInfo); | ||
} | ||
cacheKey; | ||
}; | ||
let cacheKey; | ||
precompile.cacheKey = () => { | ||
if (cacheKey === undefined) { | ||
cacheKey = makeCacheKey(templateCompilerPath, pluginInfo); | ||
} | ||
cacheKey; | ||
}; | ||
let plugin; | ||
if (options.requiresModuleApiPolyfill) { | ||
plugin = [ | ||
return [ | ||
require.resolve('babel-plugin-htmlbars-inline-precompile'), | ||
@@ -249,6 +247,8 @@ { | ||
} else { | ||
plugin = [ | ||
return [ | ||
require.resolve('babel-plugin-ember-template-compilation'), | ||
{ | ||
precompile, | ||
// As above, we present the AST transforms in reverse order | ||
transforms: [...pluginInfo.plugins].reverse(), | ||
compilerPath: require.resolve(templateCompilerPath), | ||
enableLegacyModules: [ | ||
@@ -263,4 +263,2 @@ 'ember-cli-htmlbars', | ||
} | ||
return plugin; | ||
} | ||
@@ -267,0 +265,0 @@ |
{ | ||
"name": "ember-cli-htmlbars", | ||
"version": "6.1.1", | ||
"version": "6.2.0", | ||
"description": "A library for adding htmlbars to ember CLI", | ||
@@ -36,3 +36,3 @@ "keywords": [ | ||
"@ember/edition-utils": "^1.2.0", | ||
"babel-plugin-ember-template-compilation": "^1.0.0", | ||
"babel-plugin-ember-template-compilation": "^2.0.0", | ||
"babel-plugin-htmlbars-inline-precompile": "^5.3.0", | ||
@@ -39,0 +39,0 @@ "broccoli-debug": "^0.6.5", |
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
50637
12
13
+ Added@glimmer/env@0.1.7(transitive)
+ Added@glimmer/interfaces@0.84.3(transitive)
+ Added@glimmer/syntax@0.84.3(transitive)
+ Added@glimmer/util@0.84.3(transitive)
+ Added@handlebars/parser@2.0.0(transitive)
+ Added@simple-dom/interface@1.4.0(transitive)
+ Addedbabel-import-util@3.0.0(transitive)
+ Addedbabel-plugin-ember-template-compilation@2.3.0(transitive)
+ Addedsimple-html-tokenizer@0.5.11(transitive)
- Removedbabel-import-util@1.4.1(transitive)
- Removedbabel-plugin-ember-template-compilation@1.0.2(transitive)
- Removedmagic-string@0.26.7(transitive)