Needle Engine

Changes between version 3.40.0-alpha.3 and 3.40.0-alpha.4
Files changed (1) hide show
  1. plugins/vite/config.js +8 -2
plugins/vite/config.js CHANGED
@@ -84,11 +84,17 @@
84
84
  const content = readFileSync(sveltekitConfig, 'utf8');
85
85
  const match = regex.exec(content);
86
86
  if (match) {
87
- return path.join(process.cwd(), match[1]);
87
+ const outputPath = path.join(process.cwd(), match[1]);
88
+ if (existsSync(outputPath)) {
89
+ return outputPath;
90
+ }
88
91
  }
89
92
  else {
90
93
  // default output directory
91
- return path.join(process.cwd(), 'build');
94
+ const outputPath = path.join(process.cwd(), 'build');
95
+ if (existsSync(outputPath)) {
96
+ return outputPath;
97
+ }
92
98
  }
93
99
  }
94
100
  }