From 4b23c82228a791c42d04987daa9919d85cee8d91 Mon Sep 17 00:00:00 2001 From: Kamil Jopek Date: Fri, 27 Mar 2020 15:37:36 -0600 Subject: [PATCH 1/2] Inject empty meta tag when ifa not enabled --- index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 940aaa5..63e9b7e 100644 --- a/index.js +++ b/index.js @@ -35,6 +35,10 @@ module.exports = { return; } + if (!this._config().enabled) { + return ''; + } + return ``; }, @@ -55,8 +59,7 @@ module.exports = { postBuild(build) { this._super.included.apply(this, arguments); - const env = process.env.EMBER_ENV; - const ifaConfig = this.project.config(env).ifa; + const ifaConfig = this._config(); if (!ifaConfig.enabled) { return; @@ -119,4 +122,9 @@ module.exports = { replacePlaceholder(testIndexPath, assetMap); } }, + + _config() { + const env = process.env.EMBER_ENV; + return this.project.config(env).ifa; + }, }; From cab1a9030f1fcaf99d7a3c469cb2ce93332f0ee7 Mon Sep 17 00:00:00 2001 From: Kamil Jopek Date: Fri, 27 Mar 2020 15:44:21 -0600 Subject: [PATCH 2/2] Fix typos to trigger build --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 63e9b7e..ddbda3a 100644 --- a/index.js +++ b/index.js @@ -43,11 +43,11 @@ module.exports = { }, /** - * By default, during runtime the asset-map service reads the asset map + * By default, during runtime, the asset-map service reads the asset map * information from a meta tag on the index.html. As we do not have access to * global `document` when running in fastboot, we need to implement a * different way to access this asset-map information. See - * `get-asset-map-data` where we require the `asset-map` module taht is + * `get-asset-map-data` where we require the `asset-map` module that is * generated in the postBuild() below. */ updateFastBootManifest(manifest) {