@bigcommerce/stencil-cli 5.3.4 → 5.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -133,7 +133,6 @@ internals.getResponse = async (request) => {
|
|
|
133
133
|
? JSON.parse(await readFromStream(response.data))
|
|
134
134
|
: response.data;
|
|
135
135
|
|
|
136
|
-
internals.updateTemplatePath(request.path, bcAppData);
|
|
137
136
|
// cache response
|
|
138
137
|
cache.put(
|
|
139
138
|
requestSignature,
|
|
@@ -273,7 +272,7 @@ internals.parseResponse = async (bcAppData, request, response, responseArgs) =>
|
|
|
273
272
|
internals.getResourceConfig = (data, request, configuration) => {
|
|
274
273
|
const missingThemeSettingsRegex = /{{\\s*?theme_settings\\..+?\\s*?}}/g;
|
|
275
274
|
let resourcesConfig = {};
|
|
276
|
-
const templatePath = data
|
|
275
|
+
const templatePath = internals.getTemplatePath(request.path, data);
|
|
277
276
|
|
|
278
277
|
// If the requested template is not an array, we parse the Frontmatter
|
|
279
278
|
// If it is an array, then it's an ajax request using `render_with` with multiple components
|
|
@@ -337,9 +336,9 @@ internals.redirect = async (response, request) => {
|
|
|
337
336
|
*
|
|
338
337
|
* @param {string} requestPath
|
|
339
338
|
* @param {Object} data
|
|
340
|
-
* @returns {
|
|
339
|
+
* @returns {string}
|
|
341
340
|
*/
|
|
342
|
-
internals.
|
|
341
|
+
internals.getTemplatePath = (requestPath, data) => {
|
|
343
342
|
const customLayouts = internals.options.customLayouts || {};
|
|
344
343
|
const pageType = data.page_type;
|
|
345
344
|
let templatePath;
|
|
@@ -362,10 +361,9 @@ internals.updateTemplatePath = (requestPath, data) => {
|
|
|
362
361
|
|
|
363
362
|
if (templatePath) {
|
|
364
363
|
templatePath = path.join('pages/custom', pageType, templatePath.replace(/\.html$/, ''));
|
|
365
|
-
// eslint-disable-next-line no-param-reassign
|
|
366
|
-
data.template_file = templatePath;
|
|
367
364
|
}
|
|
368
365
|
}
|
|
366
|
+
return templatePath || data.template_file;
|
|
369
367
|
};
|
|
370
368
|
|
|
371
369
|
function getAcceptLanguageHeader(request) {
|
|
@@ -406,7 +404,7 @@ internals.getPencilResponse = (data, request, response, configuration, renderedR
|
|
|
406
404
|
|
|
407
405
|
return new PencilResponse(
|
|
408
406
|
{
|
|
409
|
-
template_file:
|
|
407
|
+
template_file: internals.getTemplatePath(request.path, data),
|
|
410
408
|
templates: data.templates,
|
|
411
409
|
remote: data.remote,
|
|
412
410
|
remote_data: data.remote_data,
|