smartclient-eval
Advanced tools
Comparing version 0.9.21 to 0.9.22
@@ -37,3 +37,3 @@ { | ||
}, | ||
"version": "0.9.21" | ||
"version": "0.9.22" | ||
} |
@@ -801,7 +801,15 @@ #!/usr/bin/env node | ||
; | ||
let contextPath; | ||
if (modulesDir.startsWith(dependentPath)) { | ||
const isomorphicRegExp = this._getPathSegmentRegExp(Const.ISOMORPHIC_DIR); | ||
contextPath = modulesDir.substring(dependentPath.length + 1). | ||
match(isomorphicRegExp)[0]; | ||
modulesDir = "../../.." + Update._canonicalizePath( | ||
modulesDir.substring(dependentPath.length)); | ||
contextPath = Update._canonicalizePath(contextPath); | ||
} else { | ||
modulesDir = Update._canonicalizePath(modulesDir); | ||
console.warn("Helper pages will not be loadable for path " + modulesDir + | ||
" not under the dependent module"); | ||
} | ||
@@ -843,2 +851,6 @@ | ||
if (contextPath != null) { // add rule to allow loading of the HTML helpers | ||
contents += "\n" + this._getHelperPageLoaderConfigCode(contextPath, modulesDir); | ||
} | ||
fs.outputFileSync(loaderPath, contents); | ||
@@ -1135,2 +1147,20 @@ } | ||
/** | ||
* (Internal) Return code to configure the helper page loader | ||
* | ||
* @param (string) contextPath - loader context path or empty string | ||
* @param (string) modulesDir - path to the framework modules | ||
* @return (string) code to configure the helper page loader | ||
*/ | ||
static _getHelperPageLoaderConfigCode(contextPath, modulesDir) { | ||
const helpers = ["empty", "Log", "printFrame"]; | ||
return "require.context(\n" + | ||
" '!!file-loader?context=" + contextPath + | ||
"&name=[path][name].[ext]!" + modulesDir + "/../helpers',\n" + | ||
" true, /(" + helpers.join("|") + ")\\.html$/\n" + | ||
");\n" | ||
; | ||
} | ||
/** | ||
* (Internal) Returns whether to consider "prompt" option true | ||
@@ -1137,0 +1167,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
83358
1668