From e5b2e3b2df73cfb51a2a45ee44a0e5e1928a8a29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Wed, 28 Feb 2024 15:45:37 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20=E5=A4=84=E7=90=86edge=E5=95=86?= =?UTF-8?q?=E5=BA=97=E5=8F=91=E5=B8=83=E4=B8=8D=E8=83=BD=E5=8C=85=E5=90=AB?= =?UTF-8?q?=E5=8E=8B=E7=BC=A9=E6=96=87=E4=BB=B6=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pkg/utils/monaco-editor.ts | 2 +- webpack/webpack.dev.ts | 3 ++- webpack/webpack.no.split.ts | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pkg/utils/monaco-editor.ts b/src/pkg/utils/monaco-editor.ts index c78b6e8a..9b9cc2ab 100644 --- a/src/pkg/utils/monaco-editor.ts +++ b/src/pkg/utils/monaco-editor.ts @@ -12,7 +12,7 @@ const linterWorker = new Worker("/src/linter.worker.js"); export default function registerEditor() { // @ts-ignore window.tsUrl = ""; - fetch(chrome.runtime.getURL("/src/ts.worker.js.gz")) + fetch(chrome.runtime.getURL("/src/ts.worker.js")) .then((resp) => resp.blob()) .then(async (blob) => { const result = pako.inflate(await blob.arrayBuffer()); diff --git a/webpack/webpack.dev.ts b/webpack/webpack.dev.ts index a0ca4805..799b4da3 100644 --- a/webpack/webpack.dev.ts +++ b/webpack/webpack.dev.ts @@ -53,7 +53,8 @@ export default merge(common, { }), // firefox商店文件不能大于4M, 所以需要压缩 new CompressionPlugin({ - test: /ts.worker.js/, + test: /ts.worker.js$/, + filename: () => "ts.worker.js", deleteOriginalAssets: true, }), new NodePolyfillPlugin(), diff --git a/webpack/webpack.no.split.ts b/webpack/webpack.no.split.ts index 0edb5956..52a7b653 100644 --- a/webpack/webpack.no.split.ts +++ b/webpack/webpack.no.split.ts @@ -39,7 +39,8 @@ export default merge(common, { plugins: [ // firefox商店文件不能大于4M, 所以需要压缩 new CompressionPlugin({ - test: /ts.worker.js/, + test: /ts.worker.js$/, + filename: () => "ts.worker.js", deleteOriginalAssets: true, }), ],