mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-27 23:11:02 +00:00
Don't use cache buster
This commit is contained in:
@@ -87,7 +87,8 @@ function runEmulation(
|
||||
noInitialRun: true,
|
||||
locateFile: (path, scriptDirectory) => {
|
||||
const bitness = wasm64 ? "64" : "32";
|
||||
return `${scriptDirectory}${bitness}/${path}?${cacheBuster}`;
|
||||
const busterParams = cacheBuster ? `?${cacheBuster}` : "";
|
||||
return `${scriptDirectory}${bitness}/${path}${busterParams}`;
|
||||
},
|
||||
onRuntimeInitialized: function () {
|
||||
FS.mkdir("/root");
|
||||
@@ -105,9 +106,11 @@ function runEmulation(
|
||||
postRun: flushLines,
|
||||
};
|
||||
|
||||
const busterParams = cacheBuster ? `?${cacheBuster}` : "";
|
||||
|
||||
if (wasm64) {
|
||||
importScripts("./64/analyzer.js?" + cacheBuster);
|
||||
importScripts("./64/analyzer.js" + busterParams);
|
||||
} else {
|
||||
importScripts("./32/analyzer.js?" + cacheBuster);
|
||||
importScripts("./32/analyzer.js" + busterParams);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,12 @@
|
||||
import { ThemeProvider } from "@/components/theme-provider";
|
||||
import { TooltipProvider } from "@/components/ui/tooltip";
|
||||
import { HashRouter, Route, Routes, Navigate } from "react-router-dom";
|
||||
import { Playground, PlaygroundFile, storeEmulateData } from "./playground";
|
||||
import { Playground, storeEmulateData } from "./playground";
|
||||
import { LandingPage } from "./landing-page";
|
||||
|
||||
import { useParams } from "react-router-dom";
|
||||
|
||||
import "@fontsource/inter/100.css";
|
||||
import "@fontsource/inter/200.css";
|
||||
import "@fontsource/inter/300.css";
|
||||
import "@fontsource/inter/400.css";
|
||||
import "@fontsource/inter/500.css";
|
||||
import "@fontsource/inter/600.css";
|
||||
import "@fontsource/inter/700.css";
|
||||
import "@fontsource/inter/800.css";
|
||||
import "@fontsource/inter/900.css";
|
||||
import "@fontsource/inter/latin.css";
|
||||
|
||||
import "./App.css";
|
||||
|
||||
|
||||
@@ -73,6 +73,8 @@ function decodeEvent(data: string) {
|
||||
type StateChangeHandler = (state: EmulationState) => void;
|
||||
type StatusUpdateHandler = (status: EmulationStatus) => void;
|
||||
|
||||
const cacheBuster = undefined; //import.meta.env.VITE_BUILD_TIME || Date.now();
|
||||
|
||||
export class Emulator {
|
||||
logHandler: LogHandler;
|
||||
stateChangeHandler: StateChangeHandler;
|
||||
@@ -99,13 +101,9 @@ export class Emulator {
|
||||
this.terminateReject = reject;
|
||||
});
|
||||
|
||||
const cacheBuster = import.meta.env.VITE_BUILD_TIME || Date.now();
|
||||
|
||||
this.worker = new Worker(
|
||||
/*new URL('./emulator-worker.js', import.meta.url)*/ "./emulator-worker.js?" +
|
||||
cacheBuster,
|
||||
);
|
||||
const busterParams = cacheBuster ? `?${cacheBuster}` : "";
|
||||
|
||||
this.worker = new Worker("./emulator-worker.js" + busterParams);
|
||||
this.worker.onerror = this._onError.bind(this);
|
||||
this.worker.onmessage = (e) => queueMicrotask(() => this._onMessage(e));
|
||||
}
|
||||
@@ -124,7 +122,7 @@ export class Emulator {
|
||||
arguments: options.applicationOptions,
|
||||
persist: settings.persist,
|
||||
wasm64: settings.wasm64,
|
||||
cacheBuster: import.meta.env.VITE_BUILD_TIME || Date.now(),
|
||||
cacheBuster,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ export default defineConfig({
|
||||
},
|
||||
workbox: {
|
||||
maximumFileSizeToCacheInBytes: 100 * mb,
|
||||
cleanupOutdatedCaches: true,
|
||||
globPatterns: ["**/*.{js,css,html,woff,woff2,wasm}"],
|
||||
runtimeCaching: [
|
||||
generateExternalCache(
|
||||
|
||||
Reference in New Issue
Block a user