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

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.20c",
3
+ "version": "4.0.0-alpha.20e",
4
4
  "description": "Share components for S3 sites.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,6 +1,7 @@
1
1
  import fs from "node:fs";
2
2
  import { seasons } from "../data/seasons.js";
3
3
  import gulpHandlebarsFileInclude from "gulp-handlebars-file-include";
4
+ import merge from "lodash.merge";
4
5
 
5
6
  export function getFileFromURL(url) {
6
7
  return url.split('/').pop();
@@ -181,10 +182,7 @@ export const updateConfig = (config) => {
181
182
  const configData = fs.readFileSync('src/.tmp/config.json', 'utf8');
182
183
  const parsedConfig = JSON.parse(configData);
183
184
 
184
- mergedConfig = {
185
- ...parsedConfig,
186
- ...mergedConfig,
187
- };
185
+ mergedConfig = merge(mergedConfig, parsedConfig);
188
186
 
189
187
  // overwrite the config file with new data
190
188
  fs.writeFileSync('src/.tmp/config.json', JSON.stringify(mergedConfig, null, 2));
@@ -197,7 +195,7 @@ export const updateConfig = (config) => {
197
195
  configureServer() {
198
196
  gulpHandlebarsFileInclude(mergedConfig, { handlebarsHelpers, maxRecursion: 500 });
199
197
  },
200
- buildEnd() {
198
+ buildStart() {
201
199
  gulpHandlebarsFileInclude(mergedConfig, { handlebarsHelpers, maxRecursion: 500 });
202
200
  }
203
201
  }
package/vite.config.js CHANGED
@@ -5,9 +5,8 @@ import path from 'node:path'
5
5
  import { defaultSettings } from './src/data/config.js'
6
6
  import { defineConfig } from 'vite'
7
7
  import { startModBuild } from './tasks/serve.js'
8
- import { updateConfig, handlebarsHelpers } from './src/scripts/utils.js'
8
+ import { updateConfig } from './src/scripts/utils.js'
9
9
  import { viteStaticCopy } from 'vite-plugin-static-copy'
10
- import gulpHandlebarsFileInclude from 'gulp-handlebars-file-include'
11
10
 
12
11
  export default defineConfig((config) => ({
13
12
  build: {
@@ -54,10 +53,6 @@ export default defineConfig((config) => ({
54
53
  }),
55
54
  apply: 'serve',
56
55
  enforce: 'post'
57
- },
58
- {
59
- ...gulpHandlebarsFileInclude({}, { handlebarsHelpers, maxRecursion: 500 }),
60
- apply: 'build',
61
56
  }
62
57
  ],
63
58
  define: {