c64-ready 0.6.1 → 0.6.2
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/bin/headless.mjs +0 -0
- package/bin/serve.mjs +6 -3
- package/package.json +1 -1
package/bin/headless.mjs
CHANGED
|
File without changes
|
package/bin/serve.mjs
CHANGED
|
@@ -117,9 +117,12 @@ const server = createServer((req, res) => {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
// All other requests are resolved against dist/ directly.
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
|
|
120
|
+
// Vite bakes base='/c64-ready/' into all asset URLs, so strip that prefix
|
|
121
|
+
// before resolving so the path maps into dist/ correctly:
|
|
122
|
+
// /c64-ready/assets/index-xxx.js → dist/assets/index-xxx.js
|
|
123
|
+
// /c64.wasm → dist/c64.wasm
|
|
124
|
+
const stripped = urlPath.startsWith('/c64-ready/') ? urlPath.slice('/c64-ready/'.length) : urlPath;
|
|
125
|
+
const relative = stripped.startsWith('/') ? stripped.slice(1) : stripped;
|
|
123
126
|
const filePath = resolve(DIST_DIR, normalize(relative));
|
|
124
127
|
|
|
125
128
|
// Path traversal guard
|