From 8ae0e4769041bafd03455654b857d5746beb1891 Mon Sep 17 00:00:00 2001 From: Hufe921 Date: Tue, 7 Jun 2022 22:11:42 +0800 Subject: [PATCH] feat:update web worker import --- src/editor/core/worker/WorkerManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/editor/core/worker/WorkerManager.ts b/src/editor/core/worker/WorkerManager.ts index fc3db2d..efd2ede 100644 --- a/src/editor/core/worker/WorkerManager.ts +++ b/src/editor/core/worker/WorkerManager.ts @@ -1,4 +1,5 @@ import { Draw } from '../draw/Draw' +import WordCountWorker from './works/wordCount?worker' export class WorkerManager { @@ -7,7 +8,7 @@ export class WorkerManager { constructor(draw: Draw) { this.draw = draw - this.wordCountWorker = new Worker(new URL('./works/wordCount.ts', import.meta.url)) + this.wordCountWorker = new WordCountWorker() } public getWordCount(): Promise {