From 2d8423c516fb937d2c2c0b911bc726bddbec954e Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Tue, 27 Apr 2021 11:55:10 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=AD=20Comlink=20making=20fun=20of=20me?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/components/Import.tsx | 1 + webpack.config.js | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/components/Import.tsx b/src/client/components/Import.tsx index abf9166..180ef26 100644 --- a/src/client/components/Import.tsx +++ b/src/client/components/Import.tsx @@ -28,6 +28,7 @@ class Import extends React.Component { const worker = new Worker( new URL("../workers/extractCovers.worker", import.meta.url), ); + console.log(worker); } public render() { diff --git a/webpack.config.js b/webpack.config.js index be2ec5a..9965faf 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -13,15 +13,15 @@ module.exports = { devtool: "source-map", module: { rules: [ + { + test: /\.worker\.ts$/, + use: { loader: "worker-loader" }, + }, { test: [/\.js?$/, /\.jsx?$/, /\.tsx?$/], use: ["babel-loader"], exclude: /node_modules/, }, - // { - // test: /\.worker\.ts$/, - // use: { loader: "worker-loader" }, - // }, { enforce: "pre",