From 980633a7f52ad080fc73e63d11ef6ecf01aeb143 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Sat, 18 Nov 2023 21:36:11 +0100 Subject: [PATCH] Revert back to worklet-loader compatible syntax --- src/audio/recorderWorkletFactory.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/audio/recorderWorkletFactory.ts b/src/audio/recorderWorkletFactory.ts index efd4a9f23f..0a0c15a121 100644 --- a/src/audio/recorderWorkletFactory.ts +++ b/src/audio/recorderWorkletFactory.ts @@ -14,15 +14,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -// This import is needed for dead code analysis but not actually used because the -// built-in worker / worklet handling in Webpack 5 only supports static paths -// @ts-ignore no-unused-locals -// eslint-disable-next-line @typescript-eslint/no-unused-vars import mxRecorderWorkletPath from "./RecorderWorklet"; export default function recorderWorkletFactory(context: AudioContext): Promise { - // The context.audioWorklet.addModule syntax is required for Webpack 5 to correctly recognise - // this as a worklet rather than an asset. This also requires the parser.javascript.worker - // configuration described in https://github.com/webpack/webpack.js.org/issues/6869. - return context.audioWorklet.addModule(/* webpackChunkName: "recorder.worklet" */ new URL("./RecorderWorklet.ts", import.meta.url)); + // In future we should be using the built-in worklet support in Webpack 5 with the syntax + // described in https://github.com/webpack/webpack.js.org/issues/6869: + // addModule(/* webpackChunkName: "recorder.worklet" */ new URL("./RecorderWorklet.ts", import.meta.url)); + return context.audioWorklet.addModule(mxRecorderWorkletPath); }