diff --git a/app/config.js b/app/config.js index 3560e177bd..2f963f03dd 100644 --- a/app/config.js +++ b/app/config.js @@ -1,5 +1,6 @@ import fs from 'fs'; import path from 'path'; +import cloneDeep from 'lodash/cloneDeep'; import defaultConfig from './configurations/config.default'; import configMerger from './util/configMerger'; import { boundWithMinimumAreaSimple } from './util/geo-utils'; @@ -8,6 +9,8 @@ const configs = {}; // cache merged configs for speed const themeMap = {}; // Look up paths for various asset files const appRoot = `${process.cwd()}/`; +// eslint-disable-next-line global-require +const metaDataTemplate = require('./ssrmeta.json'); if (defaultConfig.themeMap) { Object.keys(defaultConfig.themeMap).forEach(theme => { @@ -42,8 +45,8 @@ function addMetaData(config) { } } // read metadata template and modify it to match image assets generated by favicons-webpack-plugin - // eslint-disable-next-line global-require, import/no-unresolved, no-param-reassign - config.metaData = require('./ssrmeta.json'); + // eslint-disable-next-line no-param-reassign + config.metaData = cloneDeep(metaDataTemplate); config.metaData.link.forEach(link => { // eslint-disable-next-line no-param-reassign link.href = link.href.replace('', manifestName);