Needle Engine

Changes between version 3.37.12-alpha.4 and 3.37.12-alpha.5
Files changed (2) hide show
  1. plugins/vite/config.js +4 -4
  2. plugins/vite/meta.js +2 -2
plugins/vite/config.js CHANGED
@@ -3,7 +3,7 @@
3
3
  let didLogCanNotFindConfig = false;
4
4
 
5
5
  /** the codegen meta file
6
- * @returns {import("../types/needleConfig").needleMeta | null}
6
+ * @returns {import("../types/needleConfig").needleMeta}
7
7
  */
8
8
  export async function loadConfig(path) {
9
9
  try {
@@ -26,17 +26,17 @@
26
26
  return meta;
27
27
  }
28
28
  else {
29
- if(!didLogCanNotFindConfig){
29
+ if (!didLogCanNotFindConfig) {
30
30
  didLogCanNotFindConfig = true;
31
31
  console.error("Could not find config file at " + path);
32
32
  }
33
33
  }
34
- return null;
34
+ return {};
35
35
  }
36
36
  catch (err) {
37
37
  console.error("Error loading config file");
38
38
  console.error(err);
39
- return null;
39
+ return {};
40
40
  }
41
41
  }
42
42
 
plugins/vite/meta.js CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  /**
8
8
  * @param {string} command
9
- * @param {import('../types').needleMeta} config
9
+ * @param {import('../types').needleMeta | null} config
10
10
  * @param {import('../types').userSettings} userSettings
11
11
  */
12
12
  export const needleMeta = (command, config, userSettings) => {
@@ -33,7 +33,7 @@
33
33
  // whenever vite wants to transform the html
34
34
  updateConfig();
35
35
 
36
- if (!config.license)
36
+ if (!config?.license)
37
37
  html = insertNeedleCredits(html);
38
38
 
39
39
  // early out of the config is invalid / doesn't contain meta information