Speech as a package #416

Merged
bones7242 merged 89 commits from speech-as-a-package into master 2018-04-18 21:47:34 +02:00
2 changed files with 7 additions and 3 deletions
Showing only changes of commit 9a3614da65 - Show all commits

View file

@ -19,6 +19,10 @@ export const dynamicImport = (filePath) => {
console.log('dynamicImport > filePath type:', typeof filePath);
throw new Error('file path provided to dynamicImport() must be a string');
}
if (!componentsConfig) {
console.log('no componentsConfig found in siteConfig.js');
return require(`${filePath}`);
}
// split out the file folders // filter out any empty or white-space-only strings
const folders = filePath.split('/').filter(folderName => folderName.replace(/\s/g, '').length);
// check for the component corresponding to file path in the site config object

View file

@ -10,7 +10,7 @@ function SiteConfig () {
this.auth = {
sessionKey: 'default',
};
this.customComponents = {
this.componentsConfig = {
components: {},
containers: {},
pages : {},
@ -35,13 +35,13 @@ function SiteConfig () {
if (!config) {
return console.log('No site config received.');
}
const { analytics, assetDefaults, auth, customComponents, details, publishing } = config;
const { analytics, assetDefaults, auth, componentsConfig, details, publishing } = config;
this.analytics = analytics;
this.assetDefaults = assetDefaults;
this.auth = auth;
this.details = details;
this.publishing = publishing;
this.customComponents = customComponents;
this.componentsConfig = componentsConfig;
};
};