Comparing version 3.2.0-beta.3 to 3.2.0-beta.4
{ | ||
"name": "fastboot", | ||
"version": "3.2.0-beta.3", | ||
"version": "3.2.0-beta.4", | ||
"description": "Library for rendering Ember apps in node.js", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -7,17 +7,33 @@ 'use strict'; | ||
function mergeContent(metaElement, config, configName) { | ||
let name = metaElement.getAttribute('name'); | ||
if (name && name.endsWith(configName)) { | ||
let content = JSON.parse(decodeURIComponent(metaElement.getAttribute('content'))); | ||
content.APP = Object.assign({ autoboot: false }, content.APP); | ||
config[name.slice(0, -1 * configName.length)] = content; | ||
return true; | ||
} | ||
return false; | ||
} | ||
function htmlEntrypoint(appName, distPath, htmlPath) { | ||
let html = fs.readFileSync(path.join(distPath, htmlPath), 'utf8'); | ||
let dom = new JSDOM(html); | ||
let scripts = []; | ||
let fastbootConfig = {}; | ||
let config = {}; | ||
for (let element of dom.window.document.querySelectorAll('meta')) { | ||
let name = element.getAttribute('name'); | ||
if (name && name.endsWith('/config/environment')) { | ||
let content = JSON.parse(decodeURIComponent(element.getAttribute('content'))); | ||
content.APP = Object.assign({ autoboot: false }, content.APP); | ||
config[name.slice(0, -1 * '/config/environment'.length)] = content; | ||
mergeContent(element, config, '/config/environment'); | ||
let fastbootMerged = mergeContent(element, fastbootConfig, '/config/fastboot-environment'); | ||
if (fastbootMerged) { | ||
element.remove(); | ||
} | ||
} | ||
let isFastbootConfigBuilt = Object.keys(fastbootConfig).length > 0; | ||
if (isFastbootConfigBuilt) { | ||
config = fastbootConfig; | ||
} | ||
let scripts = []; | ||
let rootURL = getRootURL(appName, config); | ||
@@ -24,0 +40,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
56914
1325
0
26639