@myvillage/cli 1.64.5 → 1.64.6
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 +1 -1
- package/src/commands/deploy.js +8 -2
package/package.json
CHANGED
package/src/commands/deploy.js
CHANGED
|
@@ -245,7 +245,10 @@ async function deployThreeJsGame(projectDir, pkg) {
|
|
|
245
245
|
formData.append('metadata', JSON.stringify(metadata));
|
|
246
246
|
|
|
247
247
|
for (const fullPath of filePaths) {
|
|
248
|
-
|
|
248
|
+
// Force POSIX separators: path.relative() returns backslashes on Windows,
|
|
249
|
+
// which would land in the S3 key (e.g. assets\foo.js) and 404 when the
|
|
250
|
+
// browser requests assets/foo.js — a blank game. (Server normalizes too.)
|
|
251
|
+
const relPath = relative(distDir, fullPath).replace(/\\/g, '/');
|
|
249
252
|
const fileBuffer = readFileSync(fullPath);
|
|
250
253
|
const blob = new Blob([fileBuffer], { type: getContentType(relPath) });
|
|
251
254
|
formData.append('files', blob, relPath);
|
|
@@ -475,7 +478,10 @@ async function deployUnityPlatform(projectDir, mvConfig, platform, { gameIdOverr
|
|
|
475
478
|
formData.append('metadata', JSON.stringify(metadata));
|
|
476
479
|
|
|
477
480
|
for (const fullPath of filePaths) {
|
|
478
|
-
|
|
481
|
+
// Force POSIX separators: path.relative() returns backslashes on Windows,
|
|
482
|
+
// which would land in the S3 key (e.g. assets\foo.js) and 404 when the
|
|
483
|
+
// browser requests assets/foo.js — a blank game. (Server normalizes too.)
|
|
484
|
+
const relPath = relative(buildDir, fullPath).replace(/\\/g, '/');
|
|
479
485
|
const fileBuffer = readFileSync(fullPath);
|
|
480
486
|
const blob = new Blob([fileBuffer], { type: getContentType(relPath) });
|
|
481
487
|
formData.append('files', blob, relPath);
|