mod-build 4.0.0-alpha.19c → 4.0.0-alpha.19e

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mod-build",
3
- "version": "4.0.0-alpha.19c",
3
+ "version": "4.0.0-alpha.19e",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -170,10 +170,7 @@ const handlebarsHelpers = [
170
170
  ]
171
171
 
172
172
  export const updateConfig = (config) => {
173
- const tempConfig = config;
174
- const configData = fs.readFileSync('src/.tmp/config.json', 'utf8');
175
- const parsedConfig = JSON.parse(configData);
176
- const mergedConfig = merge(tempConfig, parsedConfig);
173
+ let mergedConfig = { ...config };
177
174
 
178
175
  return {
179
176
  name: 'update-config',
@@ -182,9 +179,9 @@ export const updateConfig = (config) => {
182
179
  if (file.endsWith('siteconfig.js') || file.endsWith('template.js')) {
183
180
  console.log('siteconfig or template changed');
184
181
  try {
185
- const tempConfig = config;
186
182
  const configData = fs.readFileSync('src/.tmp/config.json', 'utf8');
187
183
  const parsedConfig = JSON.parse(configData);
184
+ mergedConfig = merge(parsedConfig, mergedConfig);
188
185
  // overwrite the config file with new data
189
186
  fs.writeFileSync('src/.tmp/config.json', JSON.stringify(mergedConfig, null, 2));
190
187
  } catch (error) {