Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
guyutongxue committed May 17, 2024
1 parent b76268a commit 2dc70b6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion public/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

var self_ = /** @type {ServiceWorkerGlobalScope & typeof globalThis} */ (self);

const CACHE_KEY = "v2";
const CACHE_KEY = "v3";

/**
*
Expand Down
2 changes: 1 addition & 1 deletion src/main.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const jsModule = import( /* @vite-ignore */ `${wasmBase}clangd.js`);

// Pre-fetch wasm, and report progress to main
const wasmResponse = await fetch(wasmUrl);
const wasmSize = wasmResponse.headers.get("Content-Length") ?? __WASM_SIZE__;
const wasmSize = __WASM_SIZE__;
const wasmReader = wasmResponse.body!.getReader();
let receivedLength = 0;
let chunks: Uint8Array[] = [];
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default defineConfig({
dedupe: ['monaco-editor', 'vscode']
},
define: {
// Server may not provide Content-Length header, get it in build time
// Server-provided Content-Length header may be gzipped, get the real size in build time
__WASM_SIZE__: fs.statSync("public/wasm/clangd.wasm").size,
}
});

0 comments on commit 2dc70b6

Please sign in to comment.